Advertisement
3xp1r3mind

9th sql

Aug 24th, 2012
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. POLEZNYE FUNCTIONS IN MYSQL
  2. directory language SQL
  3. USER ()-function displays login nick under which we
  4. are connected to MYSQL
  5. DATABASE ()-function displays the name of the
  6. database to which we are connected
  7. VERSION ()-displays the version of MYSQL
  8. ----------------------------
  9. ASCII (str)-returns ASCII code of first character in the
  10. string "str"
  11. CHAR (xx1, xx2 ,...)- returns a string consisting of ASCII
  12. codes which somvolov xx1, xx2, etc
  13. HEX (str)-returns the hexadecimal equivalent of 16-
  14. string "str".
  15. ----------------------------
  16. LENGTH (str) - Returns the length of the string "str".
  17. SUBSTRING (str, pos [, len])-Returns a substring of
  18. length len (if not specified before the end of string "str")
  19. characters from string "str", starting from the position
  20. pos.
  21. LOCATE (substr, str [, pos])-Returns the position of first
  22. occurrence of "substr" to the string "str" starting at
  23. position pos (unless it is specified with the beginning of
  24. the line "str"). If the substring "substr" in line "str" is
  25. missing, it returns 0.
  26. ----------------------------
  27. LOWER (str)-translates into lower case string "str" (I
  28. think only the Latin)
  29. CONCAT (param1, param2 ,...)-association substrings in
  30. one line.
  31. CONCAT_WS (sep, param1, param2 ,...)-association
  32. substrings in one string delimiter c "sep".
  33. ----------------------------
  34. IF (exp, ret1, ret2)-Check the condition exp if it is true
  35. (not 0) then returns a string ret1 but if not then returns
  36. a string ret2.
  37. ----------------------------
  38. expr BETWEEN min AND max-If the value of expr is
  39. greater than or equal to a specified value of min and
  40. less than or equal to a specified value max, then the
  41. function BETWEEN returns 1, otherwise - 0.
  42. ----------------------------
  43. AES_DECRYPT (AES_ENCRYPT ( 'string', 'bla'), 'bla')
  44. are often Newer bugs summary encoded and can be
  45. so strong do not bother using this design.
  46. ********************
  47. comments in Mysql
  48. # start a comment character in MySQL. Example
  49. SELECT pass, login FROM users # This is comment
  50. SELECT pass, login FROM users
  51. - another version of the commentary in MySQL.
  52. Required space after the sign. Example
  53. SELECT pass, login FROM users - This is comment
  54. / * * / comments similar SI in MySQL. The closing part
  55. is optional. For MySQL indeintichna gap. Example
  56. SELECT pass, login FROM users / * This is comment
  57. SELECT pass, login / * This is comment * / FROM users
  58. SELECT / ** / pass, login / ** / FROM / ** / users
  59. / *! Int * / Expansion of the previous comments. All
  60. prisoners in this comment will be interpreted as an SQL
  61. query if the number of the MySQL version is equal to
  62. the specified number of int after an exclamation point or
  63. more. Example
  64. SELECT pass / *! 32302, login * / FROM users
  65. BYE guyz....see you soon
  66. wait some tools...
  67. soon
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement