1
I (Sagi'den tarafından oluşturulan) mysql sorgusu yaşıyorum: -MySQL sayın ve Sum Satırlar
SELECT 'blr' AS Location, COUNT(*) AS playCnt, (select count(*) from blr_skip WHERE blr_skip_dt like '%2016-03-20%') as skipCnt FROM blr_play WHERE blr_play_dt like '%2016-03-20%' UNION SELECT 'chen' AS Location, COUNT(*) AS playCnt, (select count(*) from chen_skip WHERE chen_skip_dt like '%2016-03-20%') as skipCnt FROM chen_play WHERE chen_play_dt like '%2016-03-20%';
böyle çıktıyı verir: -
+----------+---------+---------+
| Location | playCnt | skipCnt |
+----------+---------+---------+
| blr | 25 | 8 |
| chen | 12 | 1 |
+----------+---------+---------+
Ben bir daha satır eklemek istiyorum böyle sütunun sonunda toplam: -
+----------+---------+---------+
| Location | playCnt | skipCnt |
+----------+---------+---------+
| blr | 25 | 8 |
| chen | 12 | 1 |
+----------+---------+---------+
|Total | 37 | 9 |
+----------+---------+---------+
Uygun bir toplam almadım. Eğer mysql dökümü dosyası istiyorsanız, o zaman burada link: - https://www.mediafire.com/?444n3tvcvj24dpm –
tamam sadece ur sorgusunda küçük bir değişiklik yaptım cazibe eklendi toplamı (playcnt), sum (skipcnt) gibi çalıştı –