MySQL Forums
Forum List  »  Newbie

SQL sub query transformation....
Posted by: Doude
Date: April 16, 2005 04:56AM

Hi,

here is the table structure :

select * from meta;

+----+---------------+--------------+------------+----------+
| id | field_name | field_type | field_unit | required |
+----+---------------+--------------+------------+----------+
| 9 | hdd capaciter| Numeric | giga | 0 |
| 8 | size | NumericRange | cm | 0 |
| 7 | resolution | Text | px | 0 |
| 10 | ecran | Numeric | pouce | 0 |
+----+---------------+--------------+------------+----------+

select * from prod_meta;

+---------+---------+----------+
| prod_id | meta_id | meta_txt |
+---------+---------+----------+
| 4 | 7 | 0 |
| 5 | 9 | 120 |
| 5 | 8 | 12 |
| 5 | 7 | 1235 |
+---------+---------+----------+

I want all the meta id and field that are not associate whit the product number 5

I have this query : SELECT id,field_name
FROM meta
WHERE id NOT IN ( SELECT id FROM prod_meta,meta
WHERE prod_meta.meta_id = meta.id
AND prod_id=5 )";

Who work fine on a systeme who can execute sub queries.

My server does not support sub query, so someone can give me the syntax for this query without sub query ?

thanks a all lot.

Options: ReplyQuote


Subject
Written By
Posted
SQL sub query transformation....
April 16, 2005 04:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.