求助?如何用MYSQL写个只选取前两条记录的语句?
用MSSQL 是这么写的,
例如:select top 2 ID,GoodsName,price,nowprice,picture from tb_goods where sale=1 order by INTime desc
但是用MYSQL怎么写呢?还有个问题MYSQL里有没有类似MSSQL里的money类型?
谢谢大侠们!!!
[解决办法]
select top 2 ID,GoodsName,price,nowprice,picture from tb_goods where sale=1 order by INTime desc
==〉
select ID,GoodsName,price,nowprice,picture from tb_goods where sale=1 order by INTime desc limit 2;MONEY类型在MYSQL中可以用两步:1、用DECIMAL类型,2、用FORMAT函数显示。比如select format(2000000.5222,3);
[解决办法]
支持ls:
----------
select ID,GoodsName,price,nowprice,picture from tb_goods where sale=1 order by INTime desc limit 2;