sql语句问题,distinct和top如何共存?
我有一张表有一些名称相同的记录,我用distinct取:
select distinct g_name,g_image_m,g_price from goods where g_isnew='y',
取出来的记录有很多,但是我只要显示前6条:
select top 6 distinct g_name,g_image_m,g_price from goods where g_isnew='y'
有错:
Microsoft JET Database Engine 错误 '80040e14'
语法错误 (操作符丢失) 在查询表达式 'distinct g_name' 中。
/ecool/index.asp,行91
似乎distinct和top不能共存,
1、请问为什么不能共存?
2、有什么解决的办法?
麻烦各位大侠不吝赐教,小弟在此先谢过!