Skip to content
Advertisement

Order by SQL line

How would I go about creating an SQL line that puts each car from new to old (Years) but also keeps it in alphabetical order

For example it needs to do this

This is how its displaying

MY View

Advertisement

Answer

You may try the following query:

The call I make to SUBSTRING_INDEX extracts the second word from the model string. This is assumed to be the model name.

enter image description here

Demo

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement