1

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

2

Re: Request

erik3318;
And where your tables
Could and lay out, if not

3

Re: Request

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

4

Re: Request

There are following tables:
Principal table Table 1: ID
Address
Subordinate table Table 2: ID
Address
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?

5

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
WHERE table2 IS NULL

[spoiler]

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]

6

Re: Request

OK. Thanks. I and made