I have a Customer
and Customer_2
table which I am trying to join together:
Both tables have data in them, but upon joining with a statement only the column names are being returned without data. I am trying to use the following join statement:
select distinct *
from Customer c
join Customer_2 d on c.CUST_NUM = d.CUST_NUM
These are the tables:
CREATE TABLE [Customer]
(
[CUST_NUM] [INT] NOT NULL,
[CUST_LNAME] [VARCHAR](50) NULL,
[CUST_FNAME] [VARCHAR](50) NULL,
CUST_BALANCE [MONEY] NOT NULL,
) ON [PRIMARY]
CREATE TABLE [Customer_2]
(
[CUST_NUM] [INT] NOT NULL,
[CUST_LNAME] [VARCHAR](50) NULL,
[CUST_FNAME] [VARCHAR](50) NULL,
) ON [PRIMARY]
Data in each Table:
INSERT INTO Customer
VALUES ('1000', 'Smith', 'Jeanne', '1050.11'),
('1001', 'Ortega', 'Juan', '840.92');
INSERT INTO CUSTOMER_2
VALUES ('2000', 'McPherson', 'Anne'),
('2001', 'Ortega', 'Juan'),
('2002', 'Kowalski', 'Jan'),
('2003', 'Chan', 'George');
Expected output would be combining customer_2 onto the bottom of the customer table with the extra column CUST_BALANCE
being 0 or null for each of the four customers on the customer 2 table.