Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting by two columns does not work?

Status
Not open for further replies.

alphaaa

Technical User
Jan 15, 2002
45
US
querying this code in perl does not work completely.
sorting occurs only by t.col1, but not with t.col2.
someone please tell me why this is happening?

select t.col1, t.col2 ,m.col1
from table_m m, table_t t
order by t.col1, t.col2
 
Try

select t.col1, t.col2 ,m.col1
from table_m AS m, table_t AS t
order by t.col1, t.col2

This is an SQL thing not a Perl thing, so it will depend on what database you are using and what version of SQL it's using. For most SQL though you do need to include the AS directive to associate an abbrieviation to a table. Barbie
Leader of Birmingham Perl Mongers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top