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

Home -> Community -> Usenet -> comp.databases.theory -> Re: a join between tables and a 'selective' update

Re: a join between tables and a 'selective' update

From: -CELKO- <jcelko212_at_earthlink.net>
Date: 18 Jan 2005 18:35:06 -0800
Message-ID: <1106102106.802197.10060@f14g2000cwb.googlegroups.com>

  1. >> Is there a simpler (but generic SQL) way to achieve the same output from given 'any logfile' set? <<

A VIEW with a UNION to put the various tables together

2) >> the ability to update just a few records [sic] of a table, records [sic] , which happen NOT to be distinguishable from one another to program making the query. <<

Then you do not have a table at all by definition. Rows are not records.

>> One of the products is milk in cans. Every milk can has a unique
(but random) serial number (ID) and validity date. When making a selection for a 'transporter' to shopping floor I'd like to select those that have earliest expiry date (are oldest). <<

SELECT I1.serial_nbr, ..
FROM Inventory AS I1
WHERE I1.product = 'milk'
AND expire_date
= (SELECT MIN(I2.expire_date)
FROM Inventory AS I2
WHERE I2.product = 'milk');

At this point you use a proprietary version of LIMIT, or I can give you a general query for the N-th element based on ordering by serial number within expiration date. Received on Tue Jan 18 2005 - 20:35:06 CST

Original text of this message

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