|
Log in | ||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to write a query to capture all the records from the table
HistoricalEvents_URLS that are not null for the field HistoricalEvents_Urls.articlerating. I also want to pull any matching records from the MasterSocietalData. Is what I wrote below correct? Select A.*,B.ArticleRating From MasterSocietalData as A Right Join HistoricalEvents_URLS as B On A.Item = B.DocItemID and B.EventID =:HistoricalEventID and B.ArticleRating is not null |
|
#2
|
|||
|
|||
|
"Mark Clark" <mcmahling@mac.com> wrote in message news:401b1dba@wic040d.... > I am trying to write a query to capture all the records from the table > HistoricalEvents_URLS that are not null for the field > HistoricalEvents_Urls.articlerating. I also want to pull any matching > records from the MasterSocietalData. Is what I wrote below correct? > > > > Select A.*,B.ArticleRating From MasterSocietalData as A Right Join > HistoricalEvents_URLS as B On A.Item = B.DocItemID and B.EventID > =:HistoricalEventID and B.ArticleRating is not null No, not quite. A right join here means show data from all rows in HistoricalEvents_URLS but show only data from the MasterSocietalData rows, which have a match in HistoricalEvents_URLS - based on the join condition. I think what you want is something like this: Select A.*, B.ArticleRating From MasterSocietalData as A Left Join HistoricalEvents_URLS as B On A.Item = B.DocItemID Where B.EventID = :HistoricalEventID and B.ArticleRating is not null; IHTH - Per |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ann: Join our Facebook fan group :) | Eivind Bakkestuen [NDD] | nexusdb.public.announcements | 0 | 6th May 2010 11:51 PM |
| Left join | Paul Evers | nexusdb.public.support.sql | 3 | 19th November 2003 01:18 AM |
| Left Outer join with 3 table? | David Charron | nexusdb.public.support.sql | 2 | 8th November 2003 03:30 AM |
| Error with more than 1 LEFT JOIN | G Lund | nexusdb.public.support.sql | 19 | 6th November 2003 08:57 PM |
| problem porting an outer join from Access --> Nexus | Lauchlan M | nexusdb.public.support.sql | 20 | 17th October 2003 03:00 AM |