SQL Server - query writeing in sql

Asked By srinu a on 02-Dec-12 11:28 AM
hi friend i have a small doubt in sql server plz tell me how to solve 


table data contins like    id,name,sal
                                  1,abc,1200
                                  2,jaid,5300
                                  3,union,1000
                                  4,ravod.200


i want output like
                            id , name,  sal ,  max(sal),   min(sal)
                           1   ,abc   ,1200  ,   null      , null
                            2  ,jaid   ,5300   ,  yes       , null
                            3,union ,  1000  , null         ,null
                            4,ravod ,200     ,null         ,   yes
when ever max value find that time display yes other wise display null values and when ever min valu find that time  disply yes other wise display null values .plz tell me how to write query in sql server
rajesh kumar replied to srinu a on 03-Dec-12 04:18 AM
try with case statement then you can get the desired result
srinu a replied to rajesh kumar on 03-Dec-12 05:31 AM
i useing case statement but result is not comeing desired.if u know plz tell me that query