对未出现在记录集中的字段选择 DISTINCT?
我想做一个SELECT DISTINCT guid, ...
,但我不希望guid
出现在记录集中。我该怎么做?
I want to do a SELECT DISTINCT guid, ...
, but I don't want guid
appearing in the recordset. How do I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您也可以这样做。
这里的缺点是您必须重复 GROUP BY 子句中的列列表,这很烦人,但其他答案也是如此。
You can also do
The drawback here is that you have to duplicate the column list in the
GROUP BY
clause, which is annoying, but the other answers do as well.将其包裹在子选择中?
Wrap it in a subselect?
首先将不同的值选择到临时表中。
然后仅选择您想要的值。
select the distinct values into a temp table first.
Then select out only the values you want.