[linux-support] Solved: Mysql: simples ? select-Statement
Markus Wernig
markus at wernig.net
Fri Apr 23 10:56:26 CEST 2004
Hi all
Dank eurer Hilfe klappt's jetzt wie folgt:
CREATE TABLE tmp SELECT * FROM $table WHERE VAL=2003;
SELECT * FROM $table as t left join tmp as tt on t.KEY=tt.KEY WHERE
tt.KEY IS NULL GROUP BY t.KEY;
gibt im untigen Beispiel den Eintrag mit Key "2" zurueck.
Danke fuer alle Tipps.
lg /m
On Thu, 2004-04-22 at 07:53, Markus Wernig wrote:
> eine Tabelle hat zwei Felder (KEY, VAL), keines unique, keines null,
> zusammen sind sie unique und ergeben den Primary Key. Ich will jetzt
> herausfinden, welcher KEY in keinem seiner VAL-Felder einen bestimmten
> Wert aufweist.
>
> also:
>
> ----------------
> | KEY | VAL |
> ----------------
> | 1 | 2001 |
> | 1 | 2002 |
> | 1 | 2003 |
> | 2 | 2001 |
> | 2 | 2002 |
> | 3 | 2002 |
> | 3 | 2003 |
> | 3 | 2004 |
> ----------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.lugbe.ch/vpipermail/linux-support/attachments/20040423/5678c168/attachment.bin
More information about the Linux-support
mailing list