select card.* from card, ranking, sort where card.crid in (0,1000000128,1000000080,1000000212,1000000129,1000000131,1000000026,1000000082,1000000172,1000000164,1000000165,1000000137,1000000203,1000000083,1000000123,1000000124,1000000125,1000000126,1000000127,1000000130,1000000132) and ranking.crid = card.crid and sort.crid = card.crid order by desc ranking.total

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'desc ranking.total' at line 1