Guest User

Untitled

a guest
Jun 25th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. create table data (
  2. id int,
  3. stage varchar(255),
  4. name varchar(255)
  5. );
  6.  
  7. id stage name
  8. ----------------------------
  9. 1 pyramid act 1
  10. 2 pyramid act 2
  11. 3 NULL act 3
  12. 4 NULL act 4
  13. 5 NULL act 5
  14. 6 NULL act 6
  15. 7 NULL act 7
  16. 8 NULL act 8
  17. 9 NULL act 9
  18. 10 NULL act 10
  19. 11 NULL act 11
  20. 12 NULL act 12
  21. 13 shangri la act 13
  22.  
  23. select *
  24. from data
  25. order by stage asc nulls first
  26. limit 5;
  27.  
  28. id stage name
  29. ----------------------------
  30. 6 NULL act 6
  31. 3 NULL act 3
  32. 4 NULL act 4
  33. 5 NULL act 5
  34. 7 NULL act 7
  35. ----------------------------
  36.  
  37. select *
  38. from data
  39. order by stage asc nulls first
  40. limit 3;
  41.  
  42. id stage name
  43. ----------------------------
  44. 4 NULL act 4
  45. 3 NULL act 3
  46. 5 NULL act 5
  47. ----------------------------
Add Comment
Please, Sign In to add comment