All pastes #286081 Raw Edit

Untitled

public text v1 · immutable
#286081 ·published 2006-12-20 10:05 UTC
rendered paste body

SELECT DISTINCT firm.name
FROM firm, invoce, pos, invoce AS i2, pos AS p2
WHERE 
    date BETWEEN '2006-09-01' AND '2006-09-30' AND
    invoce.bank = firm.bank AND
    pos.inv_id = invoce.id AND
    i2.bank = firm.bank AND i2.id != invoce.id AND
    p2.id = pos.id
;