Hi:

I'd like to store user preferences in one table, such that there are
default values but a user can override the preference. Default
preferences are stored as user 0. This is trivial to do with two
queries, but I'd like to compress it to one.  Here's an example of what
I mean:

+------+------+-------+
| user | eid  | value |
+------+------+-------+
|    0 |    1 | green |
|    0 |    2 | black |
|    1 |    1 | pink  |
+------+------+-------+

In this case, a query for user 1 should return black and pink, as the
green element was overwritten by pink (eid == element id).  

I think I'm overanalyzing this whole query, and it should be very
simple but I can only think of how to do it with two queries. 

Thanks,
m0x

__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

---------------------------------------------------------------------
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


---------------------------------------------------------------------
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