Dear Community,
I'm wanting to return data from LT_TKT_HIST where payment method = x ....but pmt_method is not available in the table.
So I try to link LT_TKT_HIST to a table that has payment method... like T_PAYMENT by linking customer_no..but this does not seem to work and is returning everything regardless of payment type.
Can this be done? Help needed
---SQL Example:
SELECT DISTINCT
a.customer_no,a.perf_name,a.perf_dt,a.order_dt,a.tck_amt,a.num_seats,a.location,b.pmt_method
FROM LT_TKT_HIST a, T_PAYMENT b
WHERE
a.customer_no = b.customer_no ANDb.pmt_method = x
Hi Aaron,
There wasn't a JOIN statement in your code, try this.
Cheers,
Kevin
a.customer_no,
a.perf_name,
a.perf_dt,
a.order_dt,
a.tck_amt,
a.num_seats,
a.location,
b.pmt_method
FROM LT_TKT_HIST a
JOIN T_PAYMENT b
on a.customer_no = b.customer_no
WHERE b.pmt_method = X
Hey thanks KM,
My query has a join?.... I just scripted it differently... however both queries (yours and mine) are returning the same data....
and I have also realised the output is actually fine.... SO IGNORE ME!! LOL...
Having one of those afternoons... :/