Это мой запрос:
select count(id) as Agendas, (select count(id) from publications) as Publication, (select count(id) from achievements) as Achievements from agenda_details
Как я могу получить результат в следующем представлении?
| serial No| Category | Counts|
| 1 | Agendas | 5 |
| 2 | Publications | 5 |
| 3 | Achievements | 5 |
Попробуйте выполнить такой запрос:
select 1 as serial_No, 'Agendas' as Category, count(id) as Counts from agenda_details
union
select 2 as serial_No, 'Publications' as Category, count(id) as Counts from publications
union
select 3 as serial_No, 'Achievements ' as Category, count(id) as Counts from achievements