I have a table named item with two attributes (code and name).
Now i want to group them in the following way:
group a: code between (5300 and 5310),(7100,7200),(8210,8290)
group b: code not between (5300 and 5310),(7100,7200),(8210,8290)
How can i do it using MySQL query?
What do you mean by ‘group’?
If you want to use GROUP BY you can do that:
Perhaps you just want to ORDER BY though?
Also note that BETWEEN includes both endpoints which might not be what you meant.