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)
分享到:
2012-02-23 16:21
浏览 451
分类:数据库
评论