sql sonuçlarının i grubu setleri, her set yüzdesini bulmak için yapabilirsiniz

0 Cevap php

Ben böyle bir sorgu yapmak olmadığını bilmek istiyorum

Select pass_fail, timestamp 
from test_execution 
where site = 'test' and timestamp between '1234567890' and '1234567890'  

Let's say this query returns 96 results because the timestamp are a 24 hour period and there's 4 results per hour. With this how can I find out the percentage of pass_fail for each hour in that 24 hour period.( there's 4 results per hour in those 24 hours so 96 total how can I find how many pass for each hour ) would I need to group results?

Would I need to Limit 4 offset 0 then increase the offset by 4 each run and average each set like that? It just seems wrong that way...any suggestions?

Teşekkürler

0 Cevap