home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.databases:8039 comp.databases.ingres:1963
- Newsgroups: comp.databases,comp.databases.ingres
- Path: sparky!uunet!dcatlas!sethg
- From: sethg@dcatlas.dot.gov (Seth Grimes)
- Subject: Re: SQL Query and a QUEL query
- Message-ID: <1992Nov23.134505.973@dcatlas.dot.gov>
- Organization: U.S Dept. of Transportation
- References: <13NOV199213095729@erich.triumf.ca> <1992Nov16.183201.13342@oracle.us.oracle.com> <1992Nov19.191535.17846@cs.rochester.edu> <1992Nov20.225217.19430@athena.mit.edu>
- Date: Mon, 23 Nov 1992 13:45:05 GMT
- Lines: 23
-
- thomasl@mtl.mit.edu (Thomas J Lohman) writes:
-
- >I want to select all entries of a table like so based on some
- >qualifications:
-
- >select ta1.name from table1 ta1, table2 ta2 where ((ta1.id = ta2.id
- >and ta2.string = "testing" and ta2.sequence = 1) and (ta1.id = ta2.id and
- >ta2.string = "testing2" and ta2.sequence = 2))
-
- Well, first of all, the ta1.id=ta2.id is given twice and second of all,
- more importantly, you'll get a null return because you have
- "ta2.sequence=1 and ta2.sequence=2" and same for ta2.sequence in your
- where clause. Maybe you meant "or" in the middle of the where and not
- "and". Assuming you did, you could render this in QUEL (if memory
- serves me correctly) as
-
- range of ta1 is table1
- range of ta2 is table2
- retrieve (ta1.name) where [same clause, corrected, as above]
-
- Oh, I notice your SQL select should have ' instead of ".
-
- Seth Grimes, dcatlas!sethg@uunet.uu.net
-