最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

无法获取唯一数据

SEO心得admin68浏览0评论
本文介绍了无法获取唯一数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

发布评论

评论列表(0)

  1. 暂无评论