Answer the question
In order to leave comments, you need to log in
Sqlite selection from multiple tables, truncated by smaller table. What request to make?
Sqlite selection from several tables, truncated by the number of documents, goods. What request to make?
There are tables of goods and documents.
When joining the table, the number of products returned by the query is equal to the number of documents, although there are more products in the documents.
SELECT docs.id as docId, docs.removed as docsRemoved, docTypes.removed as docTypesRemoved, docs.date, docTypes.name as nameDoc, rows.quantity, products.name
FROM products, docs
LEFT OUTER JOIN rows ON products.id = rows.productId
LEFT OUTER JOIN docTypes ON docTypes.id = docs.typeId and docTypes.removed = 0
WHERE rows.docId = docs.id and docs.removed = 0
GROUP BY docs.date
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question