Re: SQL Question

From: Date: Sat, 14 Oct 2000 00:21:34 +0000
Subject: Re: SQL Question
Groups: php.db 
Request: Send a blank email to php-db+get-3606@lists.php.net to get a copy of this message
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@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#3606) next »