你也可以参考下面
http://stackoverflow.com/questions/1382573/how-do-you-use-the-with-clause-in-mysql
http://stackoverflow.com/questions/324935/mysql-with-clause
类似这样、用子查询代替:select
a.*,
case
when
chances
=
(
select
max(chances)
from
a
)
then
'12'
else
null
end
flag
from
(
SELECT
'1'
name,FLOOR(1
+
(RAND()
*
10))
chances
union
all
SELECT
'2'
name,FLOOR(1
+
(RAND()
*
10))
chances
union
all
SELECT
'3'
name,FLOOR(1
+
(RAND()
*
10))
chances
)
as
a
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)