Pawan - seeing as you were "introuble" and asked "plz do fast" do you
think a thank you to Noble might be in order?
Thanks
Pat "Trouble Maker" Delaney
-----Original Message-----
From: Noble Mudenha
[mailto:mssqldba-ezmlmshield-x41457112.[Email address protected]
Sent: 27 February 2006 15:41
To: LazyDBA Discussion
Subject: RE: query required
Oh alright
Use this
select [id], minvalue, Bharati, TouchTel, IndiComm,
'first' = case when Bharati = minvalue then 'Bharati'
when TouchTel = minvalue then 'TouchTel'
when IndiComm = minvalue then 'IndiComm'
end,
'second' = case when ((Bharati between TouchTel and IndiComm) or
(Bharati
between IndiComm and TouchTel)) then 'Bharati'
when ((TouchTel between Bharati and IndiComm) or (TouchTel
between
IndiComm and Bharati)) then 'TouchTel'
when ((IndiComm between Bharati and TouchTel) or (IndiComm
between
TouchTel and Bharati)) then 'IndiComm'
end,
'third' = case when ((Bharati > TouchTel) and (Bharati > IndiComm)) then
'Bharati'
when ((TouchTel > Bharati) and (TouchTel > IndiComm)) then
'TouchTel'
when ((IndiComm > Bharati) and (IndiComm > TouchTel)) then
'IndiComm'
end
from test0
MS Sql Server LazyDBA home page