Combination of LEFT OUTER JOIN, sub-select and OR in WHERE clause fails

Combination of LEFT OUTER JOIN, sub-select and OR in WHERE clause fails

Post by nagee » Wed, 25 Jun 2003 16:16:29



Mark,

I am getting the same error (SQLCODE -338,SQLSTATE: 42972) when running
the following query!

SELECT COUNT(*)
FROM
(
NNN.FBC8EPU left outer join NNN.FBC9EPU
on
NNN.FBC8EPU.BC8COSOCE = NNN.FBC9EPU.BC9COSOCE
AND
NNN.FBC8EPU.BC8NUMAR = NNN.FBC9EPU.BC9NUMAR
AND
( NNN.FBC8EPU.BC8COSTAT = ' ' AND NNN.FBC9EPU.BC9COSTAT = ' ' ) )

What's wrong here? Any idea how solve the problem?

--
Posted via http://dbforums.com

 
 
 

Combination of LEFT OUTER JOIN, sub-select and OR in WHERE clause fails

Post by Cevdet Da » Wed, 25 Jun 2003 22:49:42


Try this one

SELECT COUNT(*)
FROM
NNN.FBC8EPU left outer join NNN.FBC9EPU
on
NNN.FBC8EPU.BC8COSOCE = NNN.FBC9EPU.BC9COSOCE
AND
NNN.FBC8EPU.BC8NUMAR = NNN.FBC9EPU.BC9NUMAR
AND
NNN.FBC8EPU.BC8COSTAT = NNN.FBC9EPU.BC9COSTAT
WHERE NNN.FBC8EPU.BC8COSTAT = ' '

Cevdet

 
 
 

Combination of LEFT OUTER JOIN, sub-select and OR in WHERE clause fails

Post by nagee » Thu, 26 Jun 2003 00:27:08


Thanks

I still  getting error, but a different one
sqlcode: -199 , sqlstate: 42601 :

The use of reserved word "<keyword>" following "<text>" is not valid.
Expected tokens may include: "<token-list>".

(=> text after  WHERE ??)

--
Posted via http://dbforums.com

 
 
 

1. LEFT OUTER LOOP JOIN and LEFT OUTER JOIN

hi all:
        for a long time, I 've been confused about how to use LEFT OUTER
LOOP JOIN and LEFT OUTER JOIN,
sometimes, when I construct a query with LEFT OUTER JOIN, it's faster than
LEFT OUTER LOOP JOIN, but there is other time,
if I construct a query with LEFT OUTER LOOP JOIN, it's faster than LEFT
OUTER JOIN,  this is a mystery to me,  does anyone know
how to use these JOIN TYPE properly?  like giving some explaination or some
examples?

                                               please help!
                                                            thanks
                                                                        -Jay

2. Overlapped I/O Error when installing SQL Server 2000

3. LEFT JOIN and LEFT OUTER JOIN

4. AMD Supported?

5. Install Ora 8I on Solaris 2.6

6. Left-Outer join and Right-Outer join

7. Replication User Account

8. Left outer join works, Right outer join just goes on for ever, processor at 100%

9. Where clause preventing Left Outer Join...

10. select for update with left outer joins?

11. LEFT OUTER JOIN vs RIGHT OUTER JION

12. LEFT OUTER JOIN faster than INNER JOIN?