Skip to content
Advertisement

How to Join two columns in same table

Charged_Count, SUM(last_charge_amt) AS Revenue FROM subscriber GROUP BY CAST(last_charged_date AS DATE)

SELECT CAST(created_date AS DATE) AS Date_time, COUNT(*) AS Registered_Count FROM subscriber GROUP BY CAST(created_date AS DATE)

I want to join last_charged_date and created_date as one column and need show Charged_Count, Revenue, and Registered_Count as separate columns according to the date

Advertisement

Answer

You can use union all :

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement