Distince Order By combinded Help Needed

P

PinkBishop

In an asp.net application I have a datalist with a gridview inside a
datalist template. The gridview is bound to the datalist select.

When I run the following some records duplicate. But without the Order
By it works fine. What do I need to change to get this to work right
with the Order By DESC?

DATALIST SELECT

SELECT DISTINCT Images.imgName, [Catalog].subID, [Catalog].imgID,
[Catalog].catID FROM (([Catalog] INNER JOIN CatalogImage ON
[Catalog].catID = CatalogImage.catID) INNER JOIN Images ON
CatalogImage.imgID = Images.imgID) WHERE ([Catalog].subID = ?) Order
By [Catalog].catID DESC


GRIDVIEW SELECT

SELECT [Catalog].catID, [Catalog].catNum, [Catalog].catPrice,
[Catalog].catDescription, Vendors.venName, Images.imgName FROM
(([Catalog] INNER JOIN Images ON [Catalog].imgID = Images.imgID) INNER
JOIN Vendors ON [Catalog].venID = Vendors.venID) WHERE
([Catalog].imgID = ?)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top