Files
rx.scoreodonto.com/query.sql
T
VPS 4 Builder a34ff8ff3d
continuous-integration/webhook Deploy concluido (rx.scoreodonto.com)
chore: test deploy script automatico
2026-05-26 06:45:18 +02:00

2 lines
397 B
SQL

SELECT patient_name, MAX(doctor) AS doctor, MAX(remark) AS remark, MAX(client_name) AS client_name, COUNT(*) AS image_count, MAX(created_at) AS last_date, (SELECT filename FROM images i2 WHERE i2.patient_name = images.patient_name AND i2.enabled = 1 ORDER BY i2.created_at DESC LIMIT 1) AS thumb_filename FROM images WHERE enabled = 1 GROUP BY patient_name ORDER BY MAX(created_at) DESC LIMIT 200