Re: [PHP-DB] SQL Question From: Ermanno Iannacci (ermannov <email protected>)
Date: 10/13/00

This is MSJET-SQL:

SELECT Table2.login
FROM Table1 LEFT JOIN Table2 ON Table1.login = Table2.login;

"LEFT JOIN" make the query choose all rows from the first table (Table1) and
only matching rows from the second table (Table 2).
Syntax can be different across different RDBMS.

--------------------------------------------------------
Hi everybody,

I've got just a quick question to you all who are familiar with SQL.

I don't know how to select records, which are in one table and not in
another one. In other terms, I want to select records which are not present
in both tables depending on one field.

For example :

Table 1
+---------+-----------+
+ Login + Password +
+---------+-----------+
+ steph + toto +
+ yann + titi +
+---------+-----------+

Table 2
+---------+-----------+-------------+--------------+ ...
+ Login +first name + second name + Address + ...
+---------+-----------+-------------+--------------+
+ steph + xxxxxx + yyyyyyyyyy + zzzzzzzzzzzzz +
+ isab + xxxxxx + yyyyyyyyyy + zzzzzzzzzzzzz +
+---------+------------+------------+--------------+

I'd like to find a SQL statement to delete the second row (isab) from Table
2 depending on the login field.

Could anyone help please ?

Thanks
Stéphane

Stéphane Cesbron
Chargé du développement Internet/Intranet

AUDENCIA
Nantes.Ecole de Management
8 route de la Jonelière
B.P. 31222
44312 Nantes Cedex 3
Tél : 02.40.37.34.47

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>