October 23, 2018 at 1:10 pm
I have two queries that I need to combine to get results together
The first query returns 3000 customer ID's
The second query returns 12 part ID's and a percentage field.
I would like my results to be
CustomerID PartID Percentage
so I would end up with each customer id being listed 12 times with the 12 different partID's and the percentage field
query 1select cmlOrganizationID from OrganizationLocations where cmlCustomerPaymentTermID !=''
query 2select impPartID,tariff = .05, from parts where partgroup='import'
October 23, 2018 at 1:31 pm
kat35601 - Tuesday, October 23, 2018 1:10 PMI have two queries that I need to combine to get results together
The first query returns 3000 customer ID's
The second query returns 12 part ID's and a percentage field.
I would like my results to be
CustomerID PartID Percentage
so I would end up with each customer id being listed 12 times with the 12 different partID's and the percentage fieldquery 1
select cmlOrganizationID from OrganizationLocations where cmlCustomerPaymentTermID !=''
query 2
select impPartID,tariff = .05, from parts where partgroup='import'
This?
select
orgloc.cmlOrganizationID
, prt.impPartID
, prt.tariff -- or is it tariff = .05
from
dbo.OrganizationLocations orgloc
cross join dbo.parts prt
where
orgloc.cmlCustomerPaymentTermID !=''
and prt.partgroup='import';
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply