|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
SELECT DISTINCT not working
I can't seem to limit my query to return only one instance of my pages.
I might have a video, audio, or zip file associated with a page and want to list the links to listen to the audio when I list the page_title I want all the pages that are in a series - even if they don't have any media linked to them If I have a page that is linked to multiple media_types, I'm getting duplicate listings in my results I added the DINSTINCT thing, but that didn't help I've played around with the "left join media " line trying INNER JOIN, RIGHT JOIN, etc. but no success any ideas? sqlPage="SELECT DISTINCT (Page.Page_ID), Page.Title, Author.Author_ID, Author.First_Name, Author.Last_Name, " & _ "Series.Series_Title, Series.Series_Description, Series.Series_Id, Page_Series.Page_Order, " & _ "Media.Media_Path, Media.Media_Filename, Media.Media_Type_ID " & _ "FROM ((Author RIGHT JOIN Page ON Author.Author_Id = Page.Author_ID) " & _ "INNER JOIN Page_Series ON Page.Page_ID = Page_Series.Page_Id) " & _ "INNER JOIN Series ON Page_Series.Series_Id = Series.Series_Id " & _ "LEFT JOIN Media ON Page.Page_ID = Media.Page_ID " & _ "WHERE (((Series.Series_Id)= " & lngSeriesID & ")) ORDER BY Page_Series.Page_Order" table structure: media table media_id media_type_id media_path media_filename page_id |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > SELECT DISTINCT not working |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|