SELECT tb_inport.id,tb_inport.goodsid,tb_goods.goodsname,tb_goods.price,tb_inport.number,tb_inport.price,tb_inport.providerid,tb_provider.providername,tb_inport.inporttime,tb_inport.operateperson FROM tb_inport,tb_goods,tb_provider where tb_goods.id=tb_inport.goodsid and tb_provider.id=tb_inport.providerid求这个查询的记录数...各位教下
SELECT FOUND_ROWS();
通过FOUND_ROWS() 就知道返回的记录数了。MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html
用SELECT COUNT(*) FROM (SELECT tb_inport.id,tb_inport.goodsid,tb_goods.goodsname,tb_goods.price,tb_inport.number,tb_inport.price,tb_inport.providerid,tb_provider.providername,tb_inport.inporttime,tb_inport.operateperson FROM tb_inport,tb_goods,tb_provider where tb_goods.id=tb_inport.goodsid and tb_provider.id=tb_inport.providerid) A
2
SELECT FOUND_ROWS()