|
|
|
|
| |
SELECT last_name, first_name FROM president;
SELECT last_name, first_name FROM member;
If it's not clear which table should be used, column names can be preceded by the table name. If it's not clear which database should be used, the table name can be preceded by the database name. You can also use these more-specific forms in unambiguous contexts if you simply want to be more explicit:
SELECT
president.last_name, president.first_name,
member.last_name, member.first_name
FROM president, member
WHERE president.last_name = member.last_name;
SELECT sampdb.student.name FROM sampdb.student;
Finally, you can combine all these kinds of values (constants, function calls, and column references) to form more complex expressions.
Operator Types
MySQL includes several kinds of operators that can be used to combine terms of expressions. Arithmetic operators, listed in Table 2.16, include the usual addition, subtraction, multiplication, and division operators, as well as the modulo operator. Arithmetic is performed using BIGINT (64-bit) integer values for +, -, and * when both operands are integers, as well as for / and % when the operation is performed in a context where the result is expected to be an integer. Otherwise, DOUBLE is used. Be aware that if an integer operation involves large values such that the result exceeds 64-bit range, you will get unpredictable results. (Actually, you should try to avoid exceeding 63-bit values; one bit is needed to represent the sign.)
|
|
|
|
|
|
| Link Partners: Asia florist, Flowers to India, Hong kong flowers, Site submit, Cheap web hosting, China florist, Japan florist |
|