Answer the question
In order to leave comments, you need to log in
How can I set my own sorting rule for a query?
Good day!
There is a plate in which the history of clients (companies) contacting for the provision of services is stored. For definiteness, the table has fields: id, id_company, date. I set the usual query to this table and sort by the date of the last access (nothing special).
I asked myself this question, is it possible to set your own sorting parameters for the query result so that the same company does not stand in a row, if possible. Something like this:
id_company | date
1-------------1.09.2016
2-------------29.08.2016
3-------------26.08 .2016
1-------------30.08.2016
2-------------28.08.2016
3------------- 25.08.2016
1-------------29.08.2016
3-------------22.08.2016
3-------------08/20/2016
Ideally, this should be all in one request (by date and its own sorting)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question