Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Really appreciate your site. Really good site for learning what others do when they run into problems. You guy's are great!!!..."

Geography

Where in the world do Tek-Tips members come from?
John1Chr (TechnicalUser)
24 Apr 12 14:06
Can you see the issue? Not sure why I am getting the error.

Select TABLE1.CTRRBVALUE,
TABLE1.CFATTRB,  
TABLE1.DESCR,
TABLE1_1.CFATTRB,
TABLE1_1.CTRRBVALUE,
TABLE1_1.DESCR
from TABLE1
inner join TABLE1_1
where 0=1
UNION ALL Select  
TABLE1.CTRRBVALUE,
TABLE1.CFATTRB,  
TABLE1.DESCR,
TABLE1_1.CFATTRB,
TABLE1_1.CTRRBVALUE,
TABLE1_1.DESCR
from TABLE1
inner join TABLE1_1
TABLE1. CTRRBVALUE = substr(TABLE1 . CTRRBVALUE , 1, 2) and
TABLE1_1. CFATTRB = 'ACTIVITY' and
TABLE1.CFATTRB = 'PROGRAM';
 
lameid (Programmer)
24 Apr 12 14:37
Looks like your joins are missing the 'ON' Keyword and missing parts.  Additionally it looks like you forgot to start your Where clause with Where in the second select.
Andrzejek (Programmer)
24 Apr 12 14:45
   
Plus:
Select TABLE1.CTRRBVALUE,
TABLE1.CFATTRB,  
TABLE1.DESCR,
TABLE1_1.CFATTRB,
TABLE1_1.CTRRBVALUE,
TABLE1_1.DESCR
from TABLE1
inner join TABLE1_1
where 0=1

UNION ALL Select  
TABLE1.CTRRBVALUE,
TABLE1.CFATTRB,  
TABLE1.DESCR,
TABLE1_1.CFATTRB,
TABLE1_1.CTRRBVALUE,
TABLE1_1.DESCR
from TABLE1
inner join TABLE1_1
TABLE1. CTRRBVALUE = substr(TABLE1 . CTRRBVALUE , 1, 2) and
TABLE1_1. CFATTRB = 'ACTIVITY' and
TABLE1.CFATTRB = 'PROGRAM'
;

You should be able to run the BLUE and RED selects independently, but can you?

In the BLUE select you join 2 tables on what?  And the WHERE 0 = 1 will never give you any results back (unless in some universe 0 equals 1 smile )

Have fun.

---- Andy

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close