gaspower Posted January 27, 2008 Share Posted January 27, 2008 Hello, I am trying to output a csv file from two tables in my database, and both tables have a products_id field. When I use the below sql statement I get the error (Column 'products_id' in where clause is ambiguous)? select * into outfile '/home/virtual/site1/var/wwww/html/temp/output.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' from products, image_maps_to_products where products_id = products_id; What am I missing to combine the output of both tables? Thanks JR Link to comment Share on other sites More sharing options...
hari_shyam Posted January 27, 2008 Share Posted January 27, 2008 Hello,I am trying to output a csv file from two tables in my database, and both tables have a products_id field. When I use the below sql statement I get the error (Column 'products_id' in where clause is ambiguous)? select * into outfile '/home/virtual/site1/var/wwww/html/temp/output.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' from products, image_maps_to_products where products_id = products_id; What am I missing to combine the output of both tables? Thanks JR Hello Sir.. put in the where condition as products.products_id = image_maps_to_products.products_id It will work fine. Regards Hari Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.