Complex SQL
Complex SQL
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')
This discussion has been closed.
Replies
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
Perfect. Thanks.