New coder here trying to figure out why my ORDER BY output is not providing the intended output.
There are 2 columns I am trying to output. Column #1 is a category number. Column #2 is an item number.
I want the results to sort according to the category # first, and then the item #net
ORDER BY tableCategories.cat_id ASC, tableItems.item_id ASC
The data I am currently querying is all from the same category number, and is numbered 1 to 54. However, the above statement will essentially order it by item# sequentially, it does not start at #1. It will either start at #12 or at number #32. Each time I hit refresh on the browser, it will toggle back and forth between starting at #12, and then the next time at #32.
If I only just order by item #, then it properly starts at #1.
Does anyone have an idea why this is happening?