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_at_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 Wed Jan 19 2005 - 03:35:06 CET

Original text of this message