Jump to content

Multiple Sorts on a Join Statement using 3 Tables


swatisonee

Recommended Posts

Hi,

 

I have the foll. $sql which works well.

 

$sqla = "SELECT * FROM Customers c INNER JOIN Custaddress a USING(CID) INNER JOIN Cities t USING(CITYID) WHERE c.Company LIKE '%$customer%' ORDER BY Company asc";

 

But if I wish to do a sort on 3 fields in 3 different tables, i'm getting an error.

 

$sqla = "SELECT * FROM Customers c INNER JOIN Custaddress a USING(CID) INNER JOIN Cities t USING(CITYID) WHERE c.Company LIKE '%$customer%' ORDER BY c. Company asc, t.City asc , a.Zip asc ";

 

Is there a way I can change this please ?

 

 

 

Thanks !

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.