这个查询怎么写才对?

sowhat0000 2003-08-21 09:34:51
select DISTINCT(b.id) a.id as aid ,a.*,b.* from material a inner join supply b on(a.supplyid=b.id)

想只显示符合条件唯一的结果集。应该怎么写才对呢?
...全文
28 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiewanji 2003-08-21
  • 打赏
  • 举报
回复
SELECT DISTINCT a.*,b.*
FROM material AS a INNER JOIN supply AS b
ON a.id = b.id
大户翁 2003-08-21
  • 打赏
  • 举报
回复
符合条件唯一的结果集 是对本条记录
非 b.id 一个字段
newly_ignorant 2003-08-21
  • 打赏
  • 举报
回复
select DISTINCT a.*,b.* from material a inner join supply b on(a.supplyid=b.id)
伍子V5 2003-08-21
  • 打赏
  • 举报
回复
select DISTINCT b.id a.id as aid ,a.*,b.* from material a inner join supply b on(a.supplyid=b.id)
romail 2003-08-21
  • 打赏
  • 举报
回复
什么意思?说清楚点啊

22,206

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧