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

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 8  |  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. Counting rows in mysql database
  2. Name / Point
  3. --------------------
  4. Pikachu  / 7
  5. Voltorb / 1
  6. Abra / 4
  7. Sunflora / 3
  8. Squirtle / 8
  9. Snorlax / 12
  10.        
  11. SELECT count(*) FROM table WHERE Point < 7 ORDER BY Point ASC
  12.        
  13. SELECT count(*) FROM table WHERE Point < 7 GROUP BY Point
  14.        
  15. select count(*) from mytable where Point<=7;
  16.        
  17. select count(*) from table where Point >= least_value and Point<= max_value
  18.        
  19. SELECT COUNT(*)
  20. FROM table
  21. WHERE POINT <= 7
  22. ORDER BY POINT DESC