Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Column 'products_id' in where clause is ambiguous


gaspower

Recommended Posts

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

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

Archived

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

×
×
  • Create New...