Column 'thetimestamp' in order clause is ambiguous

Soldato
Joined
7 Jan 2007
Posts
10,607
Location
Sussex, UK
I have a mysql database and I have successfully joined four tables, two of which have the same column titled 'thetimestamp'.

I have written a script to query these and join, then order by thetimestamp but it is erroring with:

Column 'thetimestamp' in order clause is ambiguous

how can i tell it that table1.thetimestamp = table2.thetimestamp = table3.thetimstamp etc etc

?
 
PHP:
          $query =		("SELECT * 
						FROM parentcompany
						JOIN products
						ON parentcompany.idoperators = products.idoperator JOIN company1
						ON products.idProducts = company1.idproducts JOIN company2
						ON products.idProducts = company2.idproducts

						ORDER BY thetimestamp DESC
                        LIMIT 3");
 
Back
Top Bottom