Jump to content

Mysql Select Join Across 3 Tables Error #1241


Greywacke

Recommended Posts

hi,i am currently trying to execute the following statement in phpmyadmin, the fields are all valid but i do not understand the error message i get, even after googling the web for answers. could someone please help me understand the problem?

SELECT zen_products_options_values.products_options_values_id, zen_products_options.products_options_name, zen_products_options_values.products_options_values_name FROM zen_products_options_values_to_products_options JOIN (zen_products_options, zen_products_options_values) ON (zen_products_options_values_to_products_options.products_options_id = zen_products_options.products_options_id, zen_products_options_values_to_products_options.products_options_values_id = zen_products_options_values.products_options_values_id) ORDER BY zen_products_options_values.products_options_values_idASC

the error i get is the following:#1241 - Operand should contain 1 column(s)how could i repair this statement to get these 3 columns and their values, ordered by the first column?

Link to comment
Share on other sites

lol nevermind...seems i do not need to use a join :)

SELECT zen_products_options_values.products_options_values_id, REPLACE(zen_products_options.products_options_name," :","") AS products_options_name, zen_products_options_values.products_options_values_name FROM zen_products_options_values_to_products_options, zen_products_options, zen_products_options_valuesWHERE zen_products_options_values_to_products_options.products_options_id = zen_products_options.products_options_id AND zen_products_options_values_to_products_options.products_options_values_id = zen_products_options_values.products_options_values_id ORDER BY zen_products_options.products_options_name, zen_products_options_values.products_options_values_id ASC

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...