Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SQL query puzzler

SQL query puzzler

From: <leblancsx_at_corning.com>
Date: Mon, 20 Jul 1998 22:30:39 GMT
Message-ID: <35b3c209.193850141@news-server.corning.com>


I've been thinking about how to do this for some time:

Say I have two tables, USER and COMPUTER. USER looks like this:
user_nm
user_id
COMPUTER looks like this:
computer_nm
upper_user_id
lower_user_id

I want to get ALL users and computers (return for this query will be fed to a crosstab window) and indicate somehow (with Y or N or 1 or 0) whether user_id is between upper_user_id and lower_user_id or not.

How can I do this? An outer join doesn't seem to do the trick for me. And I'm not sure of the syntax for a 'between' kind of join and being outer, if you know what I mean:

...WHERE user_id between lower_user_id and upper_user_id (+)

I've done some strange queries, but this (seemingly) simple query is eluding me. I need some expertise here.

Cheerio,



Sean LeBlanc - leblancsx_at_corning.com, cthulhu_at_mail.vicon.net Java/PowerBuilder/Informix/Sybase/SQL-Server /Oracle/C/C++/Perl/NT/Unix/ Received on Mon Jul 20 1998 - 17:30:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US