无法获取唯一数据

编程入门 行业动态 更新时间:2024-10-17 19:25:18
本文介绍了无法获取唯一数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好,我想在一个查询中从两个不同的表中获取数据,但是我无法获取唯一的数据.这是我的查询成功执行,但是我无法获取唯一的标题名称.这是我的查询..

Hi every one i want to fetch the data from two different table in a single query, but i am unable to fetch the unique data. this is my query executed successfully, but i unable to fetch the unique tittle name.this is my query..

Select Top 4 PC.Title,IM.ImageName,IM.ImageTitle,IM.ImageLocation,IM.ImageId from Images IM inner join PhotoCategory PC ON PC.AutoId = IM.Category

我的第一张桌子是PhotoCategory,第二张是图像.在我的第一个表格中有autoid和title.在Images中,标题是常见的,在其中发送autoid,我借助类别来获取标题.查询已成功执行,但是给出了相同的标题名称,并且我要唯一的数据. 请任何人帮我..... 在此先感谢...

my frist table that is PhotoCategory and second is images. In my first table has autoid and title. In Images title is common, in which i send the autoid, i am fetching the title with the help of category. query is executed successfully, but it give the same title name, and i want to unique data. Please can any one help me..... Thanks in advance...

推荐答案

朋友,谢谢您的答复,我已经解决了我的问题.. 解决方案是.. Hi Friends Thanks For Reply, I have solved my problem.. Sollution is.. select IM.ImageName,IM.ImageLocation,IM.ImageTitle,IPT.Title from Images IM inner join (select PC.autoid,PC.Title , max(IG.Autoid)as ''IGID''from PhotoCategory PC inner join Images IG on IG.category = PC.Autoid group by PC.autoid ,PC.Title)IPT ON IPT.IGID = IM.AutoId

更多推荐

无法获取唯一数据

本文发布于:2023-11-30 16:09:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1650635.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!