Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This one works:
- mysql> SELECT node.title AS node_title, node.nid AS nid, flag_content.content_id AS flag_content_content_id, book_menu_links.weight AS book_menu_links_weight
- -> FROM
- -> node node
- -> LEFT JOIN flag_content flag_content_node ON node.nid = flag_content_node.content_id AND (flag_content_node.fid = '2' AND flag_content_node.uid = '1')
- -> LEFT JOIN flag_content flag_content ON node.nid = flag_content.content_id AND (flag_content.fid = '2' AND flag_content.uid = '1' AND flag_content.sid = '0')
- -> LEFT JOIN book book ON node.nid = book.nid
- -> LEFT JOIN menu_links book_menu_links ON book.mlid = book_menu_links.mlid
- -> WHERE (( (node.status = '1') AND (node.type IN ('topic')) ))
- -> ORDER BY book_menu_links_weight ASC
- -> LIMIT 15 OFFSET 0;
- +---------------------------------------+-----+-------------------------+------------------------+
- | node_title | nid | flag_content_content_id | book_menu_links_weight |
- +---------------------------------------+-----+-------------------------+------------------------+
- | Reference Sheets | 180 | 180 | NULL |
- | Bonus Workbooks | 66 | 66 | NULL |
- | CSS notes | 73 | NULL | NULL |
- | HTML | 53 | NULL | -15 |
- | Designing With Grids | 64 | NULL | -15 |
- | Intro to Responsive Design | 107 | NULL | -15 |
- | Introduction to the Fusion Base Theme | 161 | NULL | -15 |
- | Installing Drupal | 67 | NULL | -15 |
- | Setup | 126 | NULL | -15 |
- | Introduction to the Omega Base Theme | 143 | NULL | -15 |
- | Setup | 144 | NULL | -14 |
- | Setup | 162 | NULL | -14 |
- | Adding New Style Sheets | 127 | NULL | -14 |
- | Installing the Acquia Dev Desktop | 76 | NULL | -14 |
- | Creating Your First Grid Layout | 79 | NULL | -14 |
- +---------------------------------------+-----+-------------------------+------------------------+
- 15 rows in set (0.00 sec)
- This one doesn't work:
- mysql> SELECT node.title AS node_title, node.nid AS nid, flag_content.content_id AS flag_content_content_id, book_menu_links.weight AS book_menu_links_weight
- -> FROM
- -> node node
- -> LEFT JOIN flag_content flag_content_node ON node.nid = flag_content_node.content_id AND (flag_content_node.fid = '2' AND flag_content_node.uid = '1')
- -> LEFT JOIN flag_content flag_content ON node.nid = flag_content.content_id AND (flag_content.fid = '2' AND flag_content.uid = '1' AND flag_content.sid = '0')
- -> LEFT JOIN book book ON node.nid = book.nid
- -> LEFT JOIN menu_links book_menu_links ON book.mlid = book_menu_links.mlid
- -> WHERE (( (node.status = '1') AND (node.type IN ('lesson_topic')) ))
- -> ORDER BY book_menu_links_weight ASC;
- +------------------+-----+-------------------------+------------------------+
- | node_title | nid | flag_content_content_id | book_menu_links_weight |
- +------------------+-----+-------------------------+------------------------+
- | Learning Modules | 2 | 2 | -15 |
- | Lesson Topics | 3 | NULL | -14 |
- +------------------+-----+-------------------------+------------------------+
- 2 rows in set (0.00 sec)
Advertisement
Add Comment
Please, Sign In to add comment