我如何从此表中检索唯一记录?
我有两个表:CardInfo 和 CardItems,因此每个 CardInfo 可能有多个 CardItems。我需要一个 SQL 查询来根据与 CardInfo 和 CardItems 表相关的一些条件从 CardInfo 获取唯一记录。
select c.* from CardInfo c, CardItems ci
where c.cr_no = ci.cr_no and ci.wc_id = 'test'
上述查询返回重复记录。请提出解决方案。
I have two tables: CardInfo and CardItems, so each CardInfo may have multiple CardItems. I need a SQL query to fetch unique records from CardInfo on the basis of some conditions which relates with both CardInfo and CardItems tables.
select c.* from CardInfo c, CardItems ci
where c.cr_no = ci.cr_no and ci.wc_id = 'test'
The above query return duplicate records. Please suggest a solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
DISTINCT
删除重复记录you can remove duplicate records with
DISTINCT