SELECT COUNT(*) as total FROM table_name WHERE condition=1
SELECT t.*,r.some_field as related_some_field
FROM table_name as t
LEFT JOIN related_table as r ON (r.table_id=t.id)
WHERE t.condition=1
Последний раз редактировалось Nexus, 22.02.2019 в 12:35.
|