查询条件的问题
我有一个查询,需要查询最后输入的一条记录,想用最大的日期时间值为筛选条件,可想不出怎么写,请大家帮帮,谢谢
不行呀。老师,我是想查询最后时间所开出的商品价格呀,我想到一个笨办法,
SELECT MAX(buydate) as buydate,shop, buyname,buygg,buydw GROUP BY shop, buyname,buygg,buydw FROM buying INTO CURSOR zjgx
SELECT zjgx.shop,zjgx.buyname,zjgx.buygg,zjgx.buydw,buying.buyjg FROM buying ,zjgx where zjgx.buydate=buying.buydate AND zjgx.shop=buying.shop AND zjgx.buyname=buying.buyname AND zjgx.buygg=buying.buygg AND zjgx.buydw=buying.buydw INTO CURSOR zjgx
这样用这样两句才能实现我要的效果,请老师指点。