An example of very basic join query in MySQL
This may be ugly obvious to you, but I’m so lame in SQL, that I can’t remember even simple join query. Since, this blog is also my memo, here is an example of such query. Most of you doesn’t want to read on, right? :>
So, here it is:
SELECT n.title, b.body_value AS body FROM field_data_body AS b, node AS n WHERE n.nid = b.entity_id AND n.type = 'page' GROUP BY b.entity_id
As I said, this is a very, very simple join query, that joins together title and text of all pages in Drupal site.