I
I
Ivan1462019-01-23 14:17:19
SQLite
Ivan146, 2019-01-23 14:17:19

How will the sql query sound?

Greetings. Please explain how it will sound in human :) language, indicating what's what, here's a request:

(
SELECT place.place FROM history
LEFT OUTER JOIN place ON place.id=history.id_place
WHERE 
(history.id_numbercartridge=numbercartridge.id) AND 
(    date= (SELECT MAX(date) FROM history WHERE history.id_numbercartridge=numbercartridge.id)      )
)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2019-01-23
@tsklab

Select (SELECT) the location where the last cartridge of each model is installed.
To do this, determine the date of the last installation of the cartridge model:

date= (SELECT MAX(date) FROM history WHERE history.id_numbercartridge=numbercartridge.id)

From the log, determine the place where the cartridge was installed on that day, obtaining the name of the place from the corresponding directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question