Advertisement
Guest User

mysqlsamples

a guest
Mar 17th, 2012
12,312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.40 KB | None | 0 0
  1. mysql> SELECT SUBSTRING(DATABASE(),1,1);
  2. +---------------------------+
  3. | SUBSTRING(DATABASE(),1,1) |
  4. +---------------------------+
  5. | j                         |
  6. +---------------------------+
  7. 1 ROW IN SET (0.00 sec)
  8.  
  9. mysql> SELECT ascii(SUBSTRING(DATABASE(),1,1));
  10. +----------------------------------+
  11. | ascii(SUBSTRING(DATABASE(),1,1)) |
  12. +----------------------------------+
  13. |                              106 |
  14. +----------------------------------+
  15. 1 ROW IN SET (0.00 sec)
  16.  
  17. mysql> SELECT ascii(SUBSTRING(DATABASE(),2,1));
  18. +----------------------------------+
  19. | ascii(SUBSTRING(DATABASE(),2,1)) |
  20. +----------------------------------+
  21. |                              111 |
  22. +----------------------------------+
  23. 1 ROW IN SET (0.00 sec)
  24.  
  25. mysql> SELECT IF(DATABASE()="joomla","si","no");
  26. +-----------------------------------+
  27. | IF(DATABASE()="joomla","si","no") |
  28. +-----------------------------------+
  29. | si                                |
  30. +-----------------------------------+
  31. 1 ROW IN SET (0.00 sec)
  32.  
  33. mysql> SELECT IF(ascii(SUBSTRING(DATABASE(),1,1))=106,sleep(10),NULL);
  34. +---------------------------------------------------------+
  35. | IF(ascii(SUBSTRING(DATABASE(),1,1))=106,sleep(10),NULL) |
  36. +---------------------------------------------------------+
  37. |                                                       0 |
  38. +---------------------------------------------------------+
  39. 1 ROW IN SET (10.00 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement