Hello

I work on this problem for three days now and could not find any tip in any
manual, book, tutorial or search engine.

I have the following problem:

Table1 'pl':
+---+---+
| p | o |
+---+---+
| 1 | 1 |
| 2 | 1 |
| 3 | 2 |
+---+---+

Table2 'ln':
+---+------+---+
| p |   l  | v |
+---+------+---+
| 1 | 'de' | 9 |
| 1 | 'en' | 8 |
| 1 | null | 7 |
| 2 | 'en' | 6 |
| 2 | null | 5 |
| 3 | null | 4 |
+---+------+---+

Now my problem: how to write a statement to select all 'p' and 'v' from 'pl'
and 'ln' where 'o=1' and 'l=de' or 'l=null if l=de is unavailable'. The
result is shown below:

+---+---+
| p | v |
+---+---+
| 1 | 9 |
| 2 | 5 |
+---+---+

Because I will do this on quite huge tables, an analysis on client side
would be possible but would result in megabytes of data transferred while the
database server is quite big and bored :)

Thanks for you help.

Ah, before I forget: I use MySQL server v4.0 and being not able to use 4.1
or 5.0

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to