Is there anything on the books for implementing 'Views' both for read and write, (esp. based on key relationships and joins?)

I know temporary tables give a form of view, but they aren't "live" unless updated manually and one can't insert into them and have the expected result.

-- Pseudo? SQL --

CREATE VIEW
CustomerPhoneNumberView Customer.Name as Name,
PhoneNumbers.Number as Number,
CustomerPhoneNumber.Type as Type
FROM Customer
LEFT JOIN CustomerPhoneNumber ON CustomerID
LEFT JOIN PhoneNumbers ON PhoneNumberID;

SELECT * FROM CustomerPhoneNumberView;
Name Number Type
Joe 9055551212 Phone
Bob 4165551313 Fax

INSERT INTO CustomerPhoneNumberView(Name, Number, Type) VALUES ('Gary', '7055551414', 'Phone');

Just wondering :-)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to