Click here to Skip to main content
15,886,783 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
SQL
select to_char(dat) from(select dat  from temp13 where upper(dat) =lower(dat)
order by to_number(DAT))
union all
select dat from(
select dat  from temp13 where  upper(dat) <>lower(dat) order by dat)

Pcode
10098
10054
20034
154
132
123
2004
2003
As23
Dr45
Ac45
OUTPUT
123
132
154
10034
10054
10098
2003
2004
20034
As23
Ac45
Dr45

dat varchar(50)how to use in sql server this query
Posted
Comments
Sandeep Mewara 15-Dec-10 2:13am    
Question not clear.
Abdul Quader Mamun 15-Dec-10 2:36am    
dat means date?
thatraja 15-Dec-10 4:18am    
complete your question
guayasen_o 15-Dec-10 5:55am    
I think this is a good solution, may be you have to add an order statement.

select dat from(select dat from temp13 where upper(dat) =lower(dat)) A
union all
select dat from(
select dat from temp13 where upper(dat) <>lower(dat)) B

1 solution

select dat from(select dat from temp13 where upper(dat) =lower(dat)) A union all select dat from( select dat from temp13 where upper(dat) <>lower(dat)) B
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900