首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

mysql 作为计算器应用

2012-08-17 
mysql 作为计算器使用mysql set @daily_room_charge 100Query OK, 0 rows affected (0.02 sec)?mysql

mysql 作为计算器使用

mysql> set @daily_room_charge = 100;

Query OK, 0 rows affected (0.02 sec)

?

mysql> set @num_of_nights = 3;

Query OK, 0 rows affected (0.00 sec)

?

mysql> set @tax_percent = 8;

Query OK, 0 rows affected (0.00 sec)

?

mysql> set @total_room_charge = @daily_room_charge * @num_of_nights;

Query OK, 0 rows affected (0.00 sec)

?

mysql> set @tax = (@total_room_charge * @tax_percent)/100;

Query OK, 0 rows affected (0.02 sec)

?

mysql> set @total = @total_room_charge + @tax;

Query OK, 0 rows affected (0.00 sec)

?

mysql> select @total;

+---------------+

| @total ? ? ? ?|

+---------------+

| 324.000000000 |

+---------------+

1 row in set (0.02 sec)


热点排行