MySQL Forums
Forum List  »  Newbie

Group by and ordering by special criteria
Posted by: Zoltán Kiss
Date: May 29, 2016 01:07PM

Hi everybody,

I have a headbreaking situation with my project. I need to get ordered process list of packaging processes, where i would like to get setup for machines in optimized way. That means, i want to get order, where processes are situated in list in a way, where the next coming proces will meet the prvious process adjustments. Example:

Proces1: Product:tomato Adjustment on maxhine: 350
Proces2: Product:tomato Adjustment on maxhine: 350
Proces3: Product:tomato Adjustment on maxhine: 430
Proces4: Product:pepper Adjustment on maxhine: 480
Proces5: Product:apple Adjustment on maxhine: 350

As you can see, proces 1,2 and proces 5 are having the same machine adjustment.
How can i get data in that order from database. Products must be grouped always.

It should look like:

Proces1: Product:tomato Adjustment on maxhine: 350
Proces2: Product:tomato Adjustment on maxhine: 350
Proces3: Product:apple Adjustment on maxhine: 350 //need to get this here
Proces4: Product:tomato Adjustment on maxhine: 430
Proces5: Product:pepper Adjustment on maxhine: 480

Any help appreciated.

Options: ReplyQuote


Subject
Written By
Posted
Group by and ordering by special criteria
May 29, 2016 01:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.