I am trying to create a new table that contains a count for a specific column. The column I want the count for contains different organization names. I created a new table that contains two columns one for the count and one for the organization names. I able to get the count to work, but I can't figure out how to insert into the table. This is what I have currently:
INSERT INTO ORG_countnumber (COUNT_number, OrgLBN)
SELECT
COUNT(*), OrgLBN FROM ORG_NPI_HumanName_Add_Phone GROUP BY OrgLBN
as COUNT_number,
OrgLBN
AS OrgLBN
FROM ORG_NPI_HumanName_Add_Phone;
Thanks in advance!
INSERT INTO ORG_countnumber (COUNT_number, OrgLBN) SELECT COUNT(*), OrgLBN FROM ORG_NPI_HumanName_Add_Phone GROUP BY OrgLBN