Thursday, April 9, 2009

Select State of different Case

select distinct city ,count(distinct city COLLATE SQL_Latin1_General_CP1_CS_AS) from area group by city having count(distinct city COLLATE SQL_Latin1_General_CP1_CS_AS)>1

--To Update
update dmslocation set city='Thrissur' where city COLLATE SQL_Latin1_General_CP1_CS_AS not in('Thrissur') and city like '%Thrissur%'

3 comments:

Unknown said...

very useful query

pawan kamboj said...

good thinking

Varun Bhagat said...

saalo meri queries chura kar blog p daal rahe ho..... lol