tags:

views:

31

answers:

2

hi guys

i want to use the order by catid... but i need to use it on the 2 letter of the catid field this is not working for me: order by mid(catid, 2,3)

what can be the answer?

+2  A: 

Take a look at your use of mid.

Mid ("Tech on the Net", 1, 4)   would return "Tech"
Mid ("Alphabet", 5, 2)  would return "ab"
Mid ("Alphabet", 5)     would return "abet"

Your second parameter needs to be a 2 at the very least. Not sure what your catid looks like.

SB
A: 

Try to add a new column corresponding to mid(catid, 2, 3) and order by that column

vc 74