tailieunhanh - Hướng dẫn sử dụng MySQL part 16

Giống như bất kỳ ngôn ngữ lập trình khác, SQL mang yếu tố cốt lõi của nó trong điều hành và các thủ tục đặt tên. tham chiếu này liệt kê tất cả những nhà điều hành và các chức năng và giải thích cách họ đánh giá thành các biểu thức hữu ích. | DRAFT 8 24 01 18 Operators and Functions Like any other programming language SQL carries among its core elements operators and named procedures. This reference lists all of those operators and functions and explains how they evaluate into useful expressions. Operators MySQL operators may be divided into three kinds of operators arithmetic comparison and logical. Rules of Precedence When your SQL contains complex expressions the sub-expressions are evaluated based on MySQL s rules of precedence. Of course you may always override MySQL s rules of precedence by enclosing an expression in parentheses. 1. BINARY 2. NOT 3. - unary minus 4. 5. - 6. 7. 8. 9. IN IS LIKE REGEXP 10. BETWEEN Copyright 2001 O Reilly Associates Inc. 352 DRAFT 8 24 01 11. AND 12. OR Arithmetic Operators Arithmetic operators perform basic arithmetic on two values. Adds two numerical values - Subtracts two numerical values Multiplies two numerical values Divides two numerical values Gives the modulo of two numerical values I Performs a bitwise OR on two integer values Performs a bitwise AND on two integer values Performs a bitwise left shift on an integer value Performs a bitwise right shift on an integer value Comparison Operators Comparison operators compare values and return 1 if the comparison is true 0 otherwise. Except for the operator NULL values cause a comparison operator to evaluate to NULL. or Match rows if the two values are not equal. Match rows if the left value is less than or equal to the right value. Match rows if the left value is less than the right value. Match rows if the left value is greater than or equal to the right value. Match rows if the left value is greater than the right value. value BETWEEN valuel AND value2 Match rows if value is between valuel and value2 or equal to one of them. value IN value1 value2 . Match rows if value is among the values listed. Copyright 2001 O Reilly Associates Inc. DRAFT 8 24 01 value NOT IN valuel value2 . Match rows if value is not

TỪ KHÓA LIÊN QUAN