antoniop
committed
on 18 Jul 18
Make all sql portable and bring it in line, remove code duplication