cari

Rumah  >  Soal Jawab  >  teks badan

Bagaimana untuk memaparkan hanya nilai terendah daripada set hasil (MYSQL)

Saya mempunyai kenyataan berikut:

select DATE(recieved_on) as Day, round (count(*) / 24)  AS 'average'
from message
where facility in ('FACID')
AND received on BETWEEN '2022-05-29 00:00:00' AND '2022-06-04 23:59:59'
GROUP BY DATE(received on);

Ia menyediakan set hasil berikut:

Hari Sederhana
Tarikh Nilai
Tarikh Nilai
Tarikh Nilai
Tarikh Nilai
Tarikh Nilai
Tarikh Nilai
Tarikh Nilai

Bagaimana untuk memaparkan hanya nilai terendah dalam set hasil dan bukannya kesemua 7 nilai?

P粉338969567P粉338969567228 hari yang lalu762

membalas semua(1)saya akan balas

  • P粉790819727

    P粉7908197272024-04-07 16:45:30

    Anda hanya gunakan pesanan mengikut dan hadkan:

    select DATE(recieved_on) as Day, round (count(*) / 24) AS 'average'
    from message
    where facility in ('FACID') AND received on BETWEEN '2022-05-29 00:00:00' AND '2022-06-04 23:59:59'
    GROUP BY DATE(received on)
    order by average
    limit 1

    balas
    0
  • Batalbalas