SQL logic error no such column: ord