with mySQL, i have one table where are a lot of rows with products. Every product have columns with name, stock amount and date of last purchase. And i want to get result, where all products with stock amount more than 0 are sorted by name (this group first), and then all products with stock amount 0 are sorted by last purchase. So i cant use UNION because of two order definitions. Here are some data for better understanding:

**Table data:**  

 Name | Stock | Last purchase  

 -----------------------------  

 Product 1 | 0 | 2014-09-20  

 Product 2 | 10 | 2014-09-20  

 Product 3 | 0 | 2014-09-26  

 Product 4 | 10 | 2014-09-20  

 Product 5 | 0 | 2013-08-18 

**Needed result:**  

Product 2 | 10 | 2014-09-20  

Product 4 | 10 | 2014-09-20 ... these with stock more than zero order by name ASC  

Product 1 | 0 | 2014-09-26  

Product 3 | 0 | 2014-09-20  

Product 5 | 0 | 2013-08-18 ... these with empty stock order by last purchase DESC 

I need it as one result because of pagination.