N
N
NeoZeed2016-08-03 14:52:29
1C
NeoZeed, 2016-08-03 14:52:29

In what order are the tables joined in the query?

Maybe in 1C just like everywhere else!
Let's say you need to connect a certain table (from 5 to 20 records) with a register, and from the register you need a connection to the registrar.
Obviously, it is better to first connect the table with the register, then the register with the registrar.
How, in this case, you need to write a query, i.e. in what order does the table linker join the tables?
My request:
...

ИЗ
 ТабличнаяЧастьТовары КАК ТабличнаяЧастьТовары
   ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрНакопления.ГрафикОтгрузкиТоваров КАК ГрафикОтгрузкиТоваров
      ВНУТРЕННЕЕ СОЕДИНЕНИЕ Документ.ЗаказНаВнутреннееПотребление КАК Заказ
      ПО ГрафикОтгрузкиТоваров.Регистратор = ЗаказНаВнутреннееПотребление.Ссылка
   ПО ТабличнаяЧастьТовары.Номенклатура = ГрафикОтгрузкиТоваров.Номенклатура

Or is it more correct to swap places, first what is inside the register - the document, and then the tabular part - the register?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri Goncharuk, 2016-08-03
@NeoZeed

in what order does the table linker join the tables

The request is executed by the DBMS. The 1C:Enterprise platform works with five different types of DBMS: proprietary (file version), Microsoft SQL Server, IBM DB2, Oracle Database, and PostgreSQL. Apart from differences in versions.
In each of them, the DBMS query optimizer itself determines in which order to connect queries based on a bunch of additional information about tables and already executed queries. As a result, at different points in time, the same query on the same database can be executed in different ways.
So there is no definitive answer to your question.

A
Andrey, 2016-08-12
@Andrey052

"In what order are the tables joined in the query?" - In what order they are requested, in this order it is connected.
"INNER JOIN" means that this is a subquery with the specified parameters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question