Complex SQL

Complex SQL

robobriefrobobrief Posts: 9Questions: 2Answers: 2

Does anyone know if it is be possible to replicate the following SQL statement whilst using Editor?

SELECT ul.ID, m1.meta_value AS first_field, m2.meta_value AS second_field, m3.meta_value As third_field FROM tbl_widgets ul 
JOIN tbl_widgetmeta m1 ON (m1.widget_id = ul.ID AND m1.meta_key = 'first_field') 
JOIN tbl_widgetmeta m2 ON (m2.widget_id = ul.ID AND m2.meta_key = 'second_field') 
JOIN tbl_widgetmeta m3 ON (m3.widget_id = ul.ID AND m3.meta_key = 'third_field') 

Replies

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin

    Hi,

    Editor can currently only do a left join, rather than an inner join (which join on its own will do).

    If that is okay for you, then it is possible to perform complex join operations as discussed in this thread.

    Allan

  • robobriefrobobrief Posts: 9Questions: 2Answers: 2

    Perfect. Thanks.

This discussion has been closed.