Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

sql server query Expand / Collapse
Author
Message
Posted Saturday, May 4, 2013 11:51 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, September 12, 2014 2:11 AM
Points: 211, Visits: 4,540
hi friend i have small doubt in sql .plese tell me how to solve

table data contains like below


col
10
abc
jai
20
21
kali
23
ravi
28
kum
lan
balu
31


based on this table i want separte numbers and string values
output like

Col Col1 Col2
10 10
Abc . abc
Jai . jai
20 20 .
21 21 .
Kali . kali
23 23 .
Ravi . Ravi
28 28 .
Kum . Kum
Jan . Jan
Lan . Lan
balu . Balu
31 31 .


plese tell me how to wirte query to solve this issue in sql server.
Post #1449448
Posted Saturday, May 4, 2013 12:03 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 2:50 PM
Points: 1,920, Visits: 19,334
this article may help you

http://www.sqlservercentral.com/articles/IsNumeric/71512/



SELECT col,
case when col NOT LIKE '%[^0-9]%' then col else '' end,
case when col LIKE '%[^0-9]%' then col else '' end
FROM <YOURTABLE>




______________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
Post #1449449
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse