| | |
Need a Distinct Column in my inner join statement
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2009
Posts: 4
Reputation:
Solved Threads: 0
I am using ASP with MS Access Database to create a photo album
there are two tables in the database tblGallery and tblPics each table has the following columns
tblGallery = [galleryID] [galleryName] [galleryDate]
tblPics = [picID] [picCat] [picName]
tblGallery.galleryID = tblPics.picCat in order to create a relational Database and have created the following query for my recordset
My aim now is to display the recordset in a repeating table but need to remove any records returned with the same galleryID
I have been searching for two days and although I have found a lot of similar issues which suggest using DISTINCT, GROUP BY etc... I have not yet been able to find a solution that works. I am now running out of time for my deadline so any feedback/help would be highly appreciated
Cheers
Kaden712
there are two tables in the database tblGallery and tblPics each table has the following columns
tblGallery = [galleryID] [galleryName] [galleryDate]
tblPics = [picID] [picCat] [picName]
tblGallery.galleryID = tblPics.picCat in order to create a relational Database and have created the following query for my recordset
ASP Syntax (Toggle Plain Text)
SELECT galleryID, picCat, galleryName, galleryDate, picID, picName FROM tblGallery INNER JOIN tblPics ON tblPics.picCat = tblGallery.galleryID
My aim now is to display the recordset in a repeating table but need to remove any records returned with the same galleryID
I have been searching for two days and although I have found a lot of similar issues which suggest using DISTINCT, GROUP BY etc... I have not yet been able to find a solution that works. I am now running out of time for my deadline so any feedback/help would be highly appreciated
Cheers
Kaden712
•
•
Join Date: Jul 2008
Posts: 7
Reputation:
Solved Threads: 0
If you are not going to show the details in the initial page, you can just retrieve a distinct value of galleryId and then use them to link to detail page.
eg.
Hope this suggestion is of help to you.
eg.
sql Syntax (Toggle Plain Text)
SELECT DISTINCT galleryID FROM tblGallery INNER JOIN tblPics ON tblGallery.galleryID=tblPics.picCat;
Hope this suggestion is of help to you.
Last edited by peter_budo; Jan 13th, 2009 at 5:44 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Similar Threads
- How To Combine Multiple Query? (MS SQL)
Other Threads in the ASP Forum
- Previous Thread: Concurrency checks
- Next Thread: How to place a sql query in a javascript in an asp page
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





