Need a Distinct Column in my inner join statement

Reply

Join Date: Jan 2009
Posts: 4
Reputation: kaden712 is an unknown quantity at this point 
Solved Threads: 0
kaden712 kaden712 is offline Offline
Newbie Poster

Need a Distinct Column in my inner join statement

 
0
  #1
Jan 9th, 2009
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

  1. 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
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 20
Reputation: hhamdan is an unknown quantity at this point 
Solved Threads: 0
hhamdan hhamdan is offline Offline
Newbie Poster

Re: Need a Distinct Column in my inner join statement

 
0
  #2
Jan 9th, 2009
What are you trying to do?
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 4
Reputation: kaden712 is an unknown quantity at this point 
Solved Threads: 0
kaden712 kaden712 is offline Offline
Newbie Poster

Re: Need a Distinct Column in my inner join statement

 
0
  #3
Jan 9th, 2009
The idea here is that it returns data where there is only one instance of the galleryID (doesn't matter which one) I then use this as a link to a detail page that dispalys all records for that galleryID (I have got this working fine)
Cheers
Kaden712
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 7
Reputation: nrvinayak is an unknown quantity at this point 
Solved Threads: 0
nrvinayak nrvinayak is offline Offline
Newbie Poster

Re: Need a Distinct Column in my inner join statement

 
0
  #4
Jan 12th, 2009
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.

  1. SELECT DISTINCT galleryID
  2. 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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC