ORDER BY is not working properly in MySQL -
the following select
query want order by
transtype = 'i' , after transdate in ascending order. through query can transtype = 'i' record after not displays in proper sequence.
select tranjectionid,date_format(transdate,'%d-%m-%y') transdate,motiamount, transtype,tranjection.partyid,item.itemname,gwt,loss,netwet, party.partyname,melting,westage,finewet,rhodium,amount,bhav tranjection,party,item party.partyid = tranjection.partyid , item.itemid = tranjection.itemid , tranjection.partyid = ".$partyid." order (transtype = 'r') desc, transdate
while doing order may as
order case when transtype = 'i' 0 else 1 end, transdate;
Comments
Post a Comment