SQL Query

SQL Query

sudheer_r
Not applicable
166 Views
4 Replies
Message 1 of 5

SQL Query

sudheer_r
Not applicable

[ FlexSim 20.1.2 ]

As shown in below image I am trying to Query entries based on Priority first and then among same priority by distance.

For Example below entries Product2 and Product3 are Priority 1 and Product is Priority 2. So fist order by Priority and then after that out of Product2 and Product3 I would like order by distance.

Final result should look like Product 3 then Product 2 and then Product 1.

Any feedback on what SQL Query should I use.29352-priority.png

0 Likes
Accepted solutions (1)
167 Views
4 Replies
Replies (4)
Message 2 of 5

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

You find a link in reference manual section for SQL queries in SQL Language Support to a more common site w3schools.com. There you find often more examples and variants of clauses than in FlexSim manual. This site help me a lot to build my query clauses. Here you need a query clause

ORDER BY .. ASC, .. DESC or ORDER BY .., .. ASC
Message 3 of 5

patrick_zweekhorst
Collaborator
Collaborator

Hi @Sudheer Reddy,

You could use the following query in your pull from list:

ORDER BY Priority ASC, distance DESC
This query should do the trick, if not just let me know.
Message 4 of 5

sudheer_r
Not applicable

Thanks for feedback

0 Likes
Message 5 of 5

sudheer_r
Not applicable

It helped me...thank you

0 Likes