VAAA VAAA - 4 months ago 9
SQL Question

How to convert 3 tables into 3 columns but one table

I have 3 tables in SQL that returns this results:

enter image description here

For simplicity here are some 3 selects:

SELECT 93

SELECT 101

SELECT 1



How can I convert that into one table with 3 columns:


enter image description here

Answer

One method is to just use select:

select (select 93) as registered,
       (select 101) as authorized,
       (select 1) as rejected

You can put your actual queries where the placeholders are.

Comments