Reorder select parts in query compiler fixes #5769
Reorder select parts in query compiler fixes #5769

Switching distinct and modifiers will generate proper syntax for SQL Server `SELECT DISTINCT TOP 1` instead of `SELECT TOP 1 DISTINCT`
kumamidori/cakephp,akintoey/cakephp,ionas/cakephp,justinyost/cakephp,dkarvounaris/cakephp,kumamidori/cakephp,web-player/cakephp,jeffblack360/cakephp,burriko/cakephp,burriko/cakephp,ADmad/cakephp,garethellis36/cakephp,ndm2/cakephp,burriko/cakephp,eboominathan/cakephp,davidyell/cakephp,yinhe007/cakephp,akintoey/cakephp,petteyg/cakephp,ionas/cakephp,yinhe007/cakephp,bravo-kernel/cakephp,CakeDC/cakephp,michaelze/cakephp,Balachan27/cakephp,tgr0ss/cakephp,Phillaf/cakephp,elboletaire/cakephp,CakeDC/cakephp,petteyg/cakephp,eryw/cakephp,dkarvounaris/cakephp,jjj117/cakephp,ADmad/cakephp,gmponos/cakephp,Phillaf/cakephp,garethellis36/cakephp,bravo-kernel/cakephp,thinkingmedia/cakephp,eryw/cakephp,tenkoma/cakephp,tenkoma/cakephp,eryw/cakephp,mvdriel/cakephp,kumamidori/cakephp,dakota/cakephp,khoimt/cakephp-study,garethellis36/cakephp,Balachan27/cakephp,michaelze/cakephp,eboominathan/cakephp,pbaire/cakephp,CVO-Technologies/cakephp,khoimt/cakephp-study,cakephp-fr/cakephp,petteyg/cakephp,timhoeppner/cakephp,elboletaire/cakephp,michaelze/cakephp,ndm2/cakephp,cakephp/cakephp,CVO-Technologies/cakephp,web-player/cakephp,jeffblack360/cakephp,ndm2/cakephp,berrygoudswaard/cakephp,tenkoma/cakephp,mvdriel/cakephp,web-player/cakephp,cakephp-fr/cakephp,Balachan27/cakephp,erikfig/cakephp,HavokInspiration/cakephp,thinkingmedia/cakephp,timhoeppner/cakephp,tisu2tisu/cakephp,khoimt/cakephp-study,jjj117/cakephp,cakephp/cakephp,ADmad/cakephp,jerems02/cakephp,garethellis36/cakephp,petteyg/cakephp,pbaire/cakephp,adopico/cakephp,davidyell/cakephp,timhoeppner/cakephp,yinhe007/cakephp,adopico/cakephp,berrygoudswaard/cakephp,justinyost/cakephp,eboominathan/cakephp,CakeDC/cakephp,jerems02/cakephp,pbaire/cakephp,bravo-kernel/cakephp,adopico/cakephp,dkarvounaris/cakephp,erikfig/cakephp,CakeDC/cakephp,tisu2tisu/cakephp,ADmad/cakephp,ionas/cakephp,gmponos/cakephp,jeffblack360/cakephp,nrother/cakephp,Phillaf/cakephp,elboletaire/cakephp,ndm2/cakephp,HavokInspiration/cakephp,tisu2tisu/cakephp,jerems02/cakephp,dakota/cakephp,davidyell/cakephp,cakephp/cakephp,gmponos/cakephp,nrother/cakephp,tgr0ss/cakephp,CVO-Technologies/cakephp,cakephp-fr/cakephp,jjj117/cakephp,dakota/cakephp,cakephp/cakephp,erikfig/cakephp,HavokInspiration/cakephp,akintoey/cakephp,nrother/cakephp,thinkingmedia/cakephp,justinyost/cakephp,tenkoma/cakephp,berrygoudswaard/cakephp,mvdriel/cakephp,dakota/cakephp,tgr0ss/cakephp,mvdriel/cakephp