Hi All ,

SELECT DISTINCT h_name FROM haszon;
+---------------+
| h_name        |
+---------------+
| CITROEN       |
| DAEWOO-FSO    |
| DAEWOO-LUBLIN |
| FIAT          |
| FORD          |
| GAZ           |
| HYUNDAI       |
| KIA           |
| MAZDA         |
| MERCEDES BENZ |
| MITSUBISHI    |
| NISSAN        |
| OPEL          |
| PEUGEOT       |
| RENAULT       |
| SEAT          |
| SKODA         |
| SUZUKI        |
| TATA          |
| TOYOTA        |
| VOLKSWAGEN    |
+---------------+
Query OK, 21 rows in set (0,20 sec)

SELECT cn_name FROM carname

+---------------+
| cn_name       |
+---------------+
| ALFA ROMEO    |
| AUDI          |
| BMW           |
| CHRYSLER      |
| CITROEN       |
| DAEWOO        |
| DAIHATSU      |
| DAIMLER       |
| FIAT          |
| FORD          |
| HONDA         |
| HYUNDAI       |
| JAGUAR        |
| JEEP          |
| KIA           |
| LADA          |
| LANCIA        |
| LAND ROVER    |
| LEXUS         |
| MAZDA         |
| MERCEDES BENZ |
| MG            |
| MITSUBISHI    |
| NISSAN        |
| OPEL          |
| PEUGEOT       |
| PORSCHE       |
| PROTON        |
| RENAULT       |
| ROVER         |
| SAAB          |
| SEAT          |
| SKODA         |
| SUBARU        |
| SUZUKI        |
| TOYOTA        |
| VOLKSWAGEN    |
| VOLVO         |
| <Null>        |
+---------------+
Query OK, 39 rows in set (0,35 sec)

SELECT DISTINCT h_name
FROM haszon
WHERE h_name IN (SELECT cn_name FROM carname)

+---------------+
| h_name        |
+---------------+
| CITROEN       |
| FIAT          |
| FORD          |
| HYUNDAI       |
| KIA           |
| MAZDA         |
| MERCEDES BENZ |
| MITSUBISHI    |
| NISSAN        |
| OPEL          |
| PEUGEOT       |
| RENAULT       |
| SEAT          |
| SKODA         |
| SUZUKI        |
| TOYOTA        |
| VOLKSWAGEN    |
+---------------+
Query OK, 17 rows in set (0,22 sec)

I think it's good, but
SELECT DISTINCT h_name
FROM haszon
WHERE h_name NOT IN (SELECT cn_name FROM carname)

+--------+
| h_name |
+--------+
+--------+
Query OK, 0 rows in set (0,10 sec)

Why ?

postgres-7.1 rpm on RedHat 7.0

Thanks, Gabor



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to