Hello Carl.

You are using mysql version 4+ ?

Gesundheit,
Rudi Dorn
----------------------------------------------------
Fa. AllesKunst.net I.D. GesmbH
A - 1020 Wien Zirkusgasse 39/37
Tel.: 0699 - 10 242 880
Die Firma: http://www.alleskunst.at
Das Projekt: http://www.alleskunst.net
----------------------------------------------------



----- Original Message ----- 
From: "Carl Schéle, IT, Posten" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 3:05 PM
Subject: WHERE NOT EXISTS


I use php 4.1.1. mysql 3.23.49 and phpmyadmin 2.5.4



I have two tables



classes

------------

- class_id (int)

- class_name (text)

----------------------------

HS

HD

DD

DS

MD



champions

----------------

- champions_id (int)

- year (text)

- class_name (text)

- winner (text)

----------------------------

1981 HS PETER

1981 DS ANNE



What I want to do is to list all class_name from classes that aren't
represented a specific year.

So what I want as result is HD, DD, MD

I'm trying to use the following query:



SELECT class_name FROM classes WHERE NOT EXISTS (SELECT * FROM champions
WHERE champions.class_name=classes.class_name AND champions.year='1981')



ERRORREPORT:

#1064 - You have an error in your SQL syntax.  Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'EXISTS (

SELECT  *

FROM champions

WHERE champions.class_name



Someday please help me. Am I not using the right version of php? Or is it
mysql?











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

Reply via email to