Mastering MySQL 4 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Mastering MySQL 4 [Electronic resources] - نسخه متنی

Ian Gilfillan

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید







Arithmetic Operators

Arithmetic operators perform basic mathematical calculations. If any of the values are null, the results of the entire operation are also usually null. For purposes of the calculation, strings are converted to numbers. Some strings are converted to the equivalent number (such as the strings '1' and '33'), but others are converted to 0 (such as the strings 'one' and 'abc').


+


value1 + value2

Adds two values together.

For example:

mysql> SELECT 1+3;
+-----+
| 1+3 |
+-----+
| 4 |
+-----+
mysql> SELECT 15+"9";
+--------+
| 15+"9" |
+--------+
| 24 |
+--------+




value1 - value2

Subtracts value2 from value1.

For example:

mysql> SELECT 1-9;
+-----+
| 1-9 |
+-----+
| -8 |
+-----+



*


value1 * value2

Multiplies two values with each other.

For example:

mysql> SELECT 12 * 10;
+---------+
| 12 * 10 |
+---------+
| 120 |
+---------+



/


value1 / value2

Divides value1 by value2.

For example:

mysql> SELECT 4/2;
+------+
| 4/2 |
+------+
| 2.00 |
+------+
mysql> SELECT 10005.00000/10004.00000;
+-------------------------+
| 10005.00000/10004.00000 |
+-------------------------+
| 1.0001000 |
+-------------------------+



%


Returns the modulus (remainder after value1 is divided by value2).

For example:

mysql> SELECT 3%2;
+------+
| 3%2 |
+------+
| 1 |
+------+



/ 229