Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I fix this unknown column error in sql query
    primarykey
    data
    text
    <p>I "think" I see the issue, but have not idea how to fix it</p> <p>Got some great/quick help getting my query straighten out, but now I'm getting this error: <strong>Unknown column 'caet.entity_id' in 'where clause'</strong></p> <p>The error appears in the third select statement. I want to say>> select the value where the <strong>caev</strong>.entity_id field matches the <strong>caet</strong>.entity_id. I have checked, the spelling is correct and these fields are in both tables.</p> <p>Should this work, do I need another join?</p> <pre><code>select c.*, ( select caet.value from customer_address_entity_text caet where cae.entity_id = caet.value_id and caet.attribute_id = 23 ) as test, ( select caev.value from customer_address_entity_varchar caev where caet.entity_id = caev.entity_id and caev.attribute_id = 23 ) as two from customer_entity c join customer_address_entity cae on c.`entity_id` = cae.`parent_id` where store_id = 15 </code></pre> <p>The query below shows the inner join that I tried, but still get an error:</p> <pre><code>select c.*, ( select caet.value from customer_address_entity_text caet where cae.entity_id = caet.value_id and caet.attribute_id = 23 ) as test, ( select caev.value from customer_address_entity_varchar caev where caet.entity_id = caev.entity_id and caev.attribute_id = 23 ) as two from customer_entity c join customer_address_entity cae on c.`entity_id` = cae.`parent_id` INNER JOIN customer_address_entity_text CAET ON CAET.id = CAEV.id where store_id = 8 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload