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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 sql query help needed

Author  Topic 

dupati1
Posting Yak Master

123 Posts

Posted - 2005-11-01 : 09:33:07
Hi Guys,

I have this table

[CODE]
ClientID | Address | City | State
___________________________________

101 |<Default> |Pitt |PA

102 |<Default> |Pitt |PA
102 |Pitt |Pitt |PA

103 |<Default> |Pitt |PA
103 |<Default> |Mtow |SC
103 |Cambridge |Pitt |PA
[/CODE]

i Want the result as


[CODE]
ClientID | Address | City | State
___________________________________

101 |<Default> |Pitt |PA

102 |<Default> |Pitt |PA
102 |Pitt |Pitt |PA

103 |<Default> |Pitt |PA
103 |Cambridge |Pitt |PA
103 |Columbia |Mtow |SC
[/CODE]

the thing here is...i want to SORT with in a particular ClientID...if the city and state are same and one of the address fields is <default>...i want to KEEP IT AT THE TOP and continue the sort for remaining records which have same city and state as the <default> one...for the others with different city and state, its not a problem however they are ordered...

Any suggestions...

dupati1
Posting Yak Master

123 Posts

Posted - 2005-11-01 : 09:52:06
please ignore this post...i got it solved...

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-02 : 00:57:43
How did you solve it?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -