Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Puzzles on SQL/Oracle
Bruman wrote:
> nirav wrote:
> > As far as SQL questions go, be sure to do some on Analytic Functions. > They are highly valuable but in my experience not frequently used.
Here's one of my personal favorites and generally a good interview question too.
Assume two identical tables, one named "A" the other "B" with identical column definitions. Assume that some rows in "A" are duplicated in "B" and some in "B" are duplicated in "A" but each table contains rows unique to that table.
Write a single SELECT statement that will retrieve all of the rows from table "A" that are unique to "A", all the rows from "B" that are unique to "B" and label each retrieved row with the name of the table in which it was found.
Have fun (and yes there are multiple solutions).
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Mon Dec 18 2006 - 12:52:27 CST