Time : 16:51:27 SQLSTATE[42S22]: Column not found: 1054 Unknown column 'VALUE' in 'order clause' Raw SQL : select count(mastertype.ID) as totalnew_mastertype from mastertype where mastertype.ID>0 order by VALUE desc Time : 09:54:29 SQLSTATE[42000]: Syntax error or access violation: 1064 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 'and NAME='Anand Motor Products'' at line 1 Raw SQL : select NAME,CITY,PARTYID from partydetail,contact where PARTYID=PARTY and CITY= and NAME='Anand Motor Products'