Click here to Skip to main content
15,915,703 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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
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
Posted

1 solution

Hi Thanks For Your Valuable time..
I have solved my problem.
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900