Re: Ordering dependency problem
Date: 17 Jan 2002 20:16:12 -0800
Message-ID: <cee59be7.0201172016.1ec2f74d_at_posting.google.com>
71062.1056_at_compuserve.com (--CELKO--) wrote in message news:<c0d87ec0.0201171044.656f8b4_at_posting.google.com>...
> Let me add some DDL for your example:
>
>
> I think this is the answer you wanted. Butif you wanted to scale donw
> everyone's salary to be less than any of their superiors, you will
> have to work harder.
Hi, --CELKO--, thanks for your careful answer. Seems it is a good way to solve this problem. We all agree that this problem is because the table generated by DDL is not formalized. I try to find out a simplier way to handle this problem - then I give formalized tables, but the problem seems still exists:
// these two tables are 5-NF well-formed create table personnel (empid int , salary float); create table bos_emp (bosid int, empid int);
insert ...
UPDATE Personnel
SET salary = salary * 0.8000
WHERE salary > ANY (SELECT salary
FROM Personnel AS P2, bos_emp WHERE P2.empid = bos_emp.bosid AND bos_emp.empid =Personnel.empid);
After testing, only the last record is updated.(11->8.8)
BTW, I have to pretend smart because I want to read your book for "smarty"
thanks a lot,
Qingqing Received on Fri Jan 18 2002 - 05:16:12 CET