Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Order by Condition

Author  Topic 

Easwar
Yak Posting Veteran

59 Posts

Posted - 2007-07-23 : 08:27:42
Hi all

i need simple query

pls help me

table name==>table1

field and value

id|title|topic|oid|posttime====>field(column)
----------------------------------
1 |abab|xxxxxx| 1 |2007-07-21 17:45:39.263===> datas or value
2 |adsd|ssssss| 2 |2007-07-21 16:45:39.263
3 |fdgd|aaaaaa| 3 |2007-07-21 17:40:39.223
4 |jhgd|bbbbbb| 2 |2007-07-21 18:00:09.333
5 |gdgd|ttttbb| 1 |2007-07-23 17:48:09.090
==============================================

i need result for filtering title(field name) and topic(field name) based on posttime(field name) is desc but oid(field name) is asc;

how any query

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-23 : 08:43:58
Use ORDER BY?
I have no idea what you are writing. Can't figure it out.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Easwar
Yak Posting Veteran

59 Posts

Posted - 2007-07-23 : 08:52:57
i need topic(field name) and title(field name) value based on time is desc but oid(field Name) is asc
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2007-07-23 : 09:22:03
SELECT topic,title,oid,posttime
FROM YOUR TABLE
ORDER BY posttime DESC,topic DESC, title DESC, oid ASC

Jim
Go to Top of Page

Easwar
Yak Posting Veteran

59 Posts

Posted - 2007-07-24 : 02:56:49
Thanks it's work
Go to Top of Page
   

- Advertisement -