In MS Azure, a database is created and connected to MS Access. I am trying to make a request that selects the Call ID, the name of the subscriber1, the name of the subscriber1.

In the dbo_calls table there is a list of calls with caller IDs, and in the dbo_Caller table information about subscribers dbo_calls dbo_caller

Tried to do so:

SELECT dbo_calls.Id, dbo_calls.Caller1Id, dbo_Caller.FullName, dbo_calls.Caller1Id, dbo_Caller.FullName FROM dbo_Caller INNER JOIN dbo_calls ON (dbo_Caller.Id = dbo_calls.Caller2Id) AND (dbo_Caller.Id = dbo_calls.Caller1Id); 

    1 answer 1

    Phone sex? Then it was necessary to link the calls with two "copies" of the sex participants' table.

     SELECT * FROM dbo_Calls calls JOIN dbo_Caller caller ON caller.Id = calls.Caller1Id JOIN dbo_Caller called ON called.Id = calls.Caller2Id 

    The caller is assumed to be caller1, and caller2 to be called.

    • And why duplicate information if subscribers are the same - Volodymyr Goncharov
    • What where is duplicated? - Sergey
    • > link calls with two copies of the table of participants and another question why this query does not work in ms access. In azure, the norms work - Volodymyr Goncharov
    • This is an imaginary copy. The same table can be at least 100,500 times participating in a single query. Each such participation is independent of one another. You can even establish connections between them, as with other tables: caller.id = called.id - who called himself? You can imagine that this is a "copy at the time of the request." Learn materiel. This is the basics of sql. - Sergey