本文介绍了问题在查询中定义顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,这是我的查询,用于获取数据..my表.
Hi every One this is my query which i use for fetch the data..my table.
select Top 4 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
谁能告诉我我在哪里使用
Can anyone tell me where i use
order by autoId desc
,但希望按降序给出结果,我想根据secquenc ave autoid的photocategory表获取数据,
请帮帮我
Thanks
by whish it give the result in descending order, I want to fetch the data according to photocategory table in which secquenc ave autoid,
Please help me
Thanks
推荐答案
select Top 4 IM.ImageName,IM.ImageLocation,IM.ImageTitle,IPT.Title , IPT.autoid 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 order by IPT.autoid desc
这篇关于问题在查询中定义顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!