This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select am.name, length(aml.ref), aml.ref, length(aml.name), aml.name, aa.name | |
from account_move_line aml | |
inner join account_account aa ON aa.id = aml.account_id | |
inner join account_move am ON am.id = aml.move_id | |
where aml.date at time zone 'utc' between '2018-07-01 00:00:00' and '2018-07-30 23:59:59' | |
and (length(aml.ref) > 200 or length(aml.name) > 200) | |
group by aa.name, aml.name, am.name, aml.ref |