Im trying to create a rather complicated query and Im looking for asistance.
I have 2 tables A-B-C and I want to get all records from A that are related with B-C where a condition is met in C AND all of those that are not included in B.
I have two queries like this:
a) first query
FROM A, B, C
WHERE B.A_ID = A.ID
AND B.C_ID = C.ID
AND C.c_date > '2009-05-01 23:59:59'
b) second query
WHERE A.ID NOT IN (SELECT DISTINCT B.A_ID)
I would like to mix both queries and I dont know how.
I have tried UNION but table A has some float fields and when I do the join that column goes crazy with decimal values:
0.3 appears as 0.300000011920929
I gues a left Join of shorts could work... but I cant figure it out.