dbTalk Databases Forums  

Help with Query

mailing.database.sql-general mailing.database.sql-general


Discuss Help with Query in the mailing.database.sql-general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
j_ferree@yahoo.com
 
Posts: n/a

Default Help with Query - 09-07-2005 , 12:47 PM






I have the following Query. Unfortunately the DB has a PROJ_ID = 0
that is not in the REPORTPM.PROJECT table.

How do I write the query to include those results?

select PROJECT_ID,ACTUALS_TOTAL
from REPORTPM.ALL_HOURS_MV, REPORTPM.PROJECT
where REPORTPM.ALL_HOURS_MV.PROJECT_ID = REPORTPM.PROJECT.PROJ_ID
and PROJECT_ID < 425

Thank you,

Jim


Reply With Quote
  #2  
Old   
undercups
 
Posts: n/a

Default Re: Help with Query - 09-17-2005 , 12:29 PM







j_ferree (AT) yahoo (DOT) com wrote:
Quote:
I have the following Query. Unfortunately the DB has a PROJ_ID = 0
that is not in the REPORTPM.PROJECT table.

How do I write the query to include those results?

select PROJECT_ID,ACTUALS_TOTAL
from REPORTPM.ALL_HOURS_MV, REPORTPM.PROJECT
where REPORTPM.ALL_HOURS_MV.PROJECT_ID = REPORTPM.PROJECT.PROJ_ID
and PROJECT_ID < 425

Thank you,

Jim
Try this

select PROJECT_ID,ACTUALS_TOTAL
from REPORTPM.ALL_HOURS_MV, REPORTPM.PROJECT
where REPORTPM.ALL_HOURS_MV.PROJECT_ID =* REPORTPM.PROJECT.PROJ_ID
and PROJECT_ID < 425

Note I have changed the = to =* in the where clause. I think this is
the right way round if not try *=. This is old syntax which is
relplaced with FROM table name JOIN table2 ON etc.

Hope this helps


Duncan



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.