# query in Order by

**URL:** <https://forums.percona.com/t/query-in-order-by/1083>\
**Category:** Other MySQL® Questions\
**Created:** [February 14, 2009, 12:45am UTC](https://forums.percona.com/t/query-in-order-by/1083 "2009-02-14T00:45:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaithanya\_86](https://avatars.discourse-cdn.com/v4/letter/c/ed655f/32.png) [@chaithanya\_86](https://forums.percona.com/u/chaithanya_86)\
**Post date:** [February 14, 2009, 12:45am UTC](https://forums.percona.com/t/query-in-order-by/1083/1 "2009-02-14T00:45:05Z")

</div>

hi team,  
i have a query…

I have a list of all countries in my MySQL db. while fetching the rows these will be displayed in alphabetical order. but i need Australia and New Zealand in the first and second places and rest as usual in alphabetical order. can u get me query for this please

---

<div class="post-metadata">

**Author:** ![januzi](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@januzi](https://forums.percona.com/u/januzi)\
**Post date:** [February 14, 2009, 7:35am UTC](https://forums.percona.com/t/query-in-order-by/1083/2 "2009-02-14T07:35:26Z")

</div>

You could add new column: sort\_col tinyint default 1 ; and modify two rows with Australia and New Zeland ( sort\_col = 0 )

select columns from table order by sort\_col, name

Inside mysql:  
Australia 0  
Austria 1  
New Zeland 0  
Greece 1  
Belgium 1

results from query:  
Australia 0  
New Zeland 0  
Austria 1  
Belgium 1  
Greece 1
