Chinaunix

标题: mysql SELECT 自增数显示 [打印本页]

作者: Digico    时间: 2009-03-28 14:43
标题: mysql SELECT 自增数显示
select   (@i:=@i+1)   as   i,table_name.*   from   table_name,(select   @i:=0)   as   it   order   by  

例子:
select passport,count(*) as clnumber,'20090301',(@i:=@i+1) as i,'1' from table,(select @i:=0) as it where insert_date>='$gbludate' and insert_date

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/1184/showart_1882744.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2