I
I
iluxa18102016-07-30 20:24:13
SQL
iluxa1810, 2016-07-30 20:24:13

How to quickly glue dependent records into one line?

Let's say there are 2 tables:
1) Position
2) Personnel, which refers to the Position.
One record Position can have several records from Personnel.
The task is to update [All personnel] in Position with dependent records from Personnel glued into one line.
Let's say there are 2 lines of the full name from Personnel for 1 record, we glue them together and write them into the parent record.
How to do it quickly? Access database is used.
Right now I'm using Interop, open a RecordSet from Position, and go from top to bottom, and for each record I open a second RecordSet from the query 'Select PID,FIO From [Personnel] where PID='rst.fields[ID].value and go from top to bottom and glue the values, and then return and update them in the first RecordSet and it seems to me that this is too slow and you can do it somehow faster.
It would probably be faster through ADO.NET, but it seems to me that if the Access database is healthy, then it would be too fat to load everything into memory at once ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
idShura, 2016-07-31
@idShura

Two tables can be joined in one query. Try reading about SQL Joins , for example here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question