SQL ordering
-
I have a SQL result coming as ID Created Status ================================================ 1 2008-05-10 Active 4 2008-05-11 Active 3 2008-05-12 Inactive 2 2008-05-13 Inactive I want the same to come as (Order by ID) ID Created Status ================================================ Con1 2008-05-10 Active Con2 2008-05-13 Inactive Con3 2008-05-12 Inactive Con4 2008-05-11 Active How do i do this using SQL
-
I have a SQL result coming as ID Created Status ================================================ 1 2008-05-10 Active 4 2008-05-11 Active 3 2008-05-12 Inactive 2 2008-05-13 Inactive I want the same to come as (Order by ID) ID Created Status ================================================ Con1 2008-05-10 Active Con2 2008-05-13 Inactive Con3 2008-05-12 Inactive Con4 2008-05-11 Active How do i do this using SQL
Are you wanting this for display purposes only or for saving to a DB? If you are inserting you should be able to do something like INSERT INTO tbl_WHATEVER "CON" & ID I think you could do something similar for display purposes: SELECT ("Con" & ID, Created, Status) FROM tbl_WHATEVER SORT ASC I haven't tried it though.
Shhhhh..... http://craptasticnation.blogspot.com/[^]
-
I have a SQL result coming as ID Created Status ================================================ 1 2008-05-10 Active 4 2008-05-11 Active 3 2008-05-12 Inactive 2 2008-05-13 Inactive I want the same to come as (Order by ID) ID Created Status ================================================ Con1 2008-05-10 Active Con2 2008-05-13 Inactive Con3 2008-05-12 Inactive Con4 2008-05-11 Active How do i do this using SQL
Try this: Select 'Con' + convert(varchar(20),ID), * From TableName Order by ID (desc)
Never underestimate the power of human stupidity RAH
-
I have a SQL result coming as ID Created Status ================================================ 1 2008-05-10 Active 4 2008-05-11 Active 3 2008-05-12 Inactive 2 2008-05-13 Inactive I want the same to come as (Order by ID) ID Created Status ================================================ Con1 2008-05-10 Active Con2 2008-05-13 Inactive Con3 2008-05-12 Inactive Con4 2008-05-11 Active How do i do this using SQL