my sql语法问题 my sql不支持 selete top 1 语句吗?现在有个需求,写一个函数,里面有个查询语句,只需返回一条记录的值select colval into ret from testtab where ...这条语句ret可能会有多条记录我现在只取第一条,返回咋实现 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 my sql不支持 selete top 1 语句吗?不支持select colval into ret from testtab where .. order by ... limit 1 谢谢楼上。my sql有没有个类似ms sqlserver的 print函数SELECT count(*) into @a FROM tab.element;print @a我想看 @a的值 mysql没有top功能,只能select * from table order by 字段 desc 或 asc limit 1 直接SELECT就行了。select @a; MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html select colval into @ret from testtab where ...select @ret; 我使用 mysql query browser工具写查询语句的SELECT count(*) into @a FROM tab.element;SELECT @a;按上面这样输入,结果是 NULL, 而正常查询count(*)的时候有值 select colval into @ret from testtab where .. order by ... limit 1;SELECT @RET; 一个表,查一周内相同时间的记录数 MYSQL如果实现存储过程加密 mysql limit 动态赋值问题 MYSQL的if里面能不有别的语句 MySQL奇怪问题,请教各位前辈了!急,在线等! 请问在postgres中什么类型数据和 tinyint一样,表示范围0-255,大小1字节呢 时差问题 jsp插入mysql数据库后乱码,实在没办法了,求救!!!!!!! 请教两个MYSQL的问题 Got error 134 from table handler(紧急求救) ●●●●一个折腾了我很久的纠结问题,数据库关系问题,我这样行吗? sql语句递归查询
print @a
我想看 @a的值
select @ret;
SELECT @a;按上面这样输入,结果是 NULL, 而正常查询count(*)的时候有值
SELECT @RET;