Make super shit SQL slightly less shit