May 25, 2005 at 1:07 pm
I have a table tab1 which has data as
insert into tab1 values(16 ,'\html')
insert into tab1 values(17 ,'html')
insert into tab1 values(18, 'html')
insert into tab1 values(82 ,'html123')
insert into tab1 values(89 ,'123html')
is there any way i can display the data as
17 ,'html'
18, 'html'
and then the rest of the rows. i tried all wasy even usinga union but didnt help. any soln will be greatly appreciated.
TIA
May 25, 2005 at 1:12 pm
select id, txtData, 1 ord From Yourtable where txtData ='html'
union all
select id, txtData, 2 ord From Yourtable where txtData <>'html'
order by ord, id, txtData
* Noel
May 25, 2005 at 1:15 pm
Awesome . Thanks for the help...
May 25, 2005 at 1:17 pm
No problem, Happy to help
* Noel
May 25, 2005 at 1:27 pm
Another neat trick that you might like :
select id, txtData From Yourtable order by case txtDate when 'html' then 0 else 1 end
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply