tsql - Order Sql Request with top Percent -


i have exception when execute query think created, error : msg 102, niveau 15, État 1, ligne 6 syntaxe incorrecte vers ')'. here request :

 select distinct designation    (select top 100 percent designation , code_piececomptable   cpt_lignepiececomptable    code_piececomptable in    (select code_piececomptable    cpt_piececomptable    terminer  null or terminer <>1)    order code_piececomptable) 

you need give alias:

 select distinct designation    (select top 100 percent designation , code_piececomptable   cpt_lignepiececomptable    code_piececomptable in    (select code_piececomptable    cpt_piececomptable    terminer  null or terminer <>1)    order code_piececomptable) q 

take note q tacked on end.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -