测试一下, 好像是可行的呀!
mysql> select @test := 1+------------+
| @test := 1 |
+------------+
| 1 |
+------------+
1 row in set (0.00 sec)
mysql> select * from test_main
+----+-------+
| id | value |
+----+-------+
| 1 | ONE |
| 2 | TWO |
| 3 | THREE |
+----+-------+
3 rows in set (0.00 sec)
mysql> select * from test_main where id > @test
+----+-------+
| id | value |
+----+-------+
| 2 | TWO |
| 3 | THREE |
+----+-------+
2 rows in set (0.00 sec)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)