ok ho provato sembrerebbe funzionare. mi è uscita una query lunghissima xò sembra ok.

grazie a tutti