Posted by : ஆனந்த் சதாசிவம் Thursday, June 6, 2013

Using IF..ELSE in UPDATE:

SQL:

Select Query:

select propertyid,e.name as username,case p.bactive when 1 then 'tick.gif' else 'cross.gif' end as bActive from tbl_Property p inner join enquiry e on p.userid=e.enqiry_id"


Update Query:
update tbl_Property set bactive=(case bactive when '1' then '0' else '1' end)  where  propertyid=14

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Popular Post

Blogger templates

Labels

Search Box

Follow us on Facebook

- Copyright © .net -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -