Topic: Request

Help the student!
I have two tables.
to display only those records field value in which in two tables do not coincide
Excuse for a stupid question


Re: Request

And where your tables
Could and lay out, if not


Re: Request

SELECT Tablitsa1.*
FROM Tablitsa1 LEFT JOIN of Tablitsa2 ON of Tablitsa1. =2. A field
WHERE Tablitsa2. Field Is Null
SELECT Tablitsa2.*
FROM Tablitsa2 LEFT JOIN of Tablitsa1 ON of Tablitsa1. =2. A field
WHERE Tablitsa1. Field Is Null


Re: Request

There are following tables:
Principal table Table 1: ID
Subordinate table Table 2: ID
Roughly speaking to me it is necessary from Table 1 to take away Table 2
I do request by means of Join. It to me deduces conterminous lines. I want to deduce those lines Table which 1 was not present in Table 2.
If in body JOIN  I write..... Table1.ID <> Table2.ID it deduces not correctly (i.e. more than it is necessary). Probably it compares each record of table 1 of table 2.
Whether it is possible to solve this task one request?


Re: Request

erik3318 wrote:

I should from Table 1 take away Table 2

the Companion hm-m-m answered... Why you did not attend it at least to read? All right, I will repeat for a specific target...

SELECT table1.*
FROM table1
LEFT JOIN table2 ON table1.id = table2.id


erik3318 wrote:

records field value in which in two tables do not coincide

Formally - if in one table there are at least 2 records, it is necessary to deduce everything for for any of them there will be a record not coinciding with it from another.
It is necessary to think is better over the statements. [/spoiler]


Re: Request

OK. Thanks. I and made