Guest User

Untitled

a guest
Jun 12th, 2012
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. This one works:
  2.  
  3. 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
  4. -> FROM
  5. -> node node
  6. -> 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')
  7. -> 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')
  8. -> LEFT JOIN book book ON node.nid = book.nid
  9. -> LEFT JOIN menu_links book_menu_links ON book.mlid = book_menu_links.mlid
  10. -> WHERE (( (node.status = '1') AND (node.type IN ('topic')) ))
  11. -> ORDER BY book_menu_links_weight ASC
  12. -> LIMIT 15 OFFSET 0;
  13. +---------------------------------------+-----+-------------------------+------------------------+
  14. | node_title | nid | flag_content_content_id | book_menu_links_weight |
  15. +---------------------------------------+-----+-------------------------+------------------------+
  16. | Reference Sheets | 180 | 180 | NULL |
  17. | Bonus Workbooks | 66 | 66 | NULL |
  18. | CSS notes | 73 | NULL | NULL |
  19. | HTML | 53 | NULL | -15 |
  20. | Designing With Grids | 64 | NULL | -15 |
  21. | Intro to Responsive Design | 107 | NULL | -15 |
  22. | Introduction to the Fusion Base Theme | 161 | NULL | -15 |
  23. | Installing Drupal | 67 | NULL | -15 |
  24. | Setup | 126 | NULL | -15 |
  25. | Introduction to the Omega Base Theme | 143 | NULL | -15 |
  26. | Setup | 144 | NULL | -14 |
  27. | Setup | 162 | NULL | -14 |
  28. | Adding New Style Sheets | 127 | NULL | -14 |
  29. | Installing the Acquia Dev Desktop | 76 | NULL | -14 |
  30. | Creating Your First Grid Layout | 79 | NULL | -14 |
  31. +---------------------------------------+-----+-------------------------+------------------------+
  32. 15 rows in set (0.00 sec)
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39. This one doesn't work:
  40.  
  41. 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
  42. -> FROM
  43. -> node node
  44. -> 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')
  45. -> 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')
  46. -> LEFT JOIN book book ON node.nid = book.nid
  47. -> LEFT JOIN menu_links book_menu_links ON book.mlid = book_menu_links.mlid
  48. -> WHERE (( (node.status = '1') AND (node.type IN ('lesson_topic')) ))
  49. -> ORDER BY book_menu_links_weight ASC;
  50. +------------------+-----+-------------------------+------------------------+
  51. | node_title | nid | flag_content_content_id | book_menu_links_weight |
  52. +------------------+-----+-------------------------+------------------------+
  53. | Learning Modules | 2 | 2 | -15 |
  54. | Lesson Topics | 3 | NULL | -14 |
  55. +------------------+-----+-------------------------+------------------------+
  56. 2 rows in set (0.00 sec)
Advertisement
Add Comment
Please, Sign In to add comment