select lowest,highest value from multiple column mysql

by Jayanthi 2013-10-14 13:12:32

select lowest,highest value from multiple coloumn





product namequal_no1qual_no2qual_no3
moong dal17689100


Compare multiple columns get lowest,higest price

select * ,
least(qual_no1, qual_no2, qual_no3) as lowprice,
greatest(qual_no1, qual_no2, qual_no3) as highprice from product
where productname = 'moong dal' order by lowest_price



output




product namequal_no1qual_no2qual_no3lowpricehighprice
moong dal1768910089176

Tagged in:

1132
like
0
dislike
0
mail
flag

You must LOGIN to add comments