i create table orderSales, typeCustomer, Customer
i create view
SELECT [id]
,[OrderDate]
,[Total]
,[Pay]
,[Remain]
,[Sales]
,[ValueAdd]
,[CustomerType]
,[Name]
FROM [dbo].[vOrdersAll]
GO
but view Get 3 row only and table OrderSales has more than 3 row
What I have tried:
i create view
SELECT [id]
,[OrderDate]
,[Total]
,[Pay]
,[Remain]
,[Sales]
,[ValueAdd]
,[CustomerType]
,[Name]
FROM [dbo].[vOrdersAll]
view query
SELECT dbo.tbOrderSales.id, dbo.tbOrderSales.OrderDate, dbo.tbOrderSales.Total, dbo.tbOrderSales.Pay, dbo.tbOrderSales.Remain, dbo.tbOrderSales.Sales, dbo.tbOrderSales.ValueAdd, dbo.tblCustomerType.CustomerType,
dbo.tbCustomers.Name
FROM dbo.tbCustomers INNER JOIN
dbo.tblCustomerType ON dbo.tbCustomers.id = dbo.tblCustomerType.id INNER JOIN
dbo.tbOrderSales ON dbo.tbCustomers.Phone = dbo.tbOrderSales.Customers AND dbo.tblCustomerType.id = dbo.tbOrderSales.typeCustomer