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 based on two columns

Author  Topic 

goligol
Posting Yak Master

128 Posts

Posted - 2011-11-28 : 15:26:46
I am having the following query, I want to order the new table with the two columns:

SELECT distinct a.district
,b.[port_district]

FROM [trade].[dev].[test] a
,[trade].[dev].[test] b


where a.district = left(b.port_district,2)

order by a.district """""""and b.port_district""""

how should I include the and b.port_district part

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-11-28 : 15:45:46
[code]order by a.district, b.port_district[/code]
Go to Top of Page

goligol
Posting Yak Master

128 Posts

Posted - 2011-11-28 : 16:04:08
Thank you
Go to Top of Page
   

- Advertisement -