| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: a join between tables and a 'selective' update
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
![]() |
![]() |