Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.41 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. how to select rows from two tables and one and group them
  2. news_table:
  3. id,title,category,date;
  4. 1,hello,2,2012
  5.  
  6. categories_table:
  7. id,category,parent
  8. 1,news,0
  9.        
  10. cat:news
  11.  
  12. title              date
  13. title 2             date
  14. title 3            date
  15.  
  16. cat:general
  17. title          date
  18. title2          date
  19.        
  20. select * from news_table left join categories_table on news_table.category = categories_table.id where .....