I have 2 tables:
Invoice
CustomerInvoiceID - PK
RecordLocator - Text
createdDate - date
SimplifiedInvoice
CustomerInvoiceID - PK / FK Invoices
CountryCode - text
VatPercentage - number
SubtotalAmount - number
TotalAmount - number
If I run the following query:
select
si.CountryCode,
si.RecordLocator,
si.CustomerInvoiceID,
i.CreatedDate,
i.VatPercentage,
si.SubTotalAmount,
si.TotalAmount
from
SimpliedInvoice si , invoice i
where
si.CustomerInvoiceID = i.CustomerInvoiceID
and si.CountryCode = 'GR'
My result is an empty dataset.
But if I run this query:
select *
from SimpliedInvoice
where CustomerInvoiceID in (select CustomerInvoiceID
from Invoice
where CountryCode = 'GR')
I get plenty of data.
I am not able to see why, any idea?
2