SQL Server & Tibco Spotfire Ideas & Samples
SQL, TSQL, Tibco Spotfire...
Nov 19, 2008
sql case statement with selecting records.
select case
when len(id)=5 then 'CO'+'000'+cast(id as varchar(5))
when len(id)=6 then 'CO'+'00'+cast(id as varchar(6))
when len(id)=7 then 'CO'+'0'+cast(id as varchar(7))
end,ContactPosition,CompanyID
from contact_id_temp
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment