开发者

sql select - order by but partial part of the field

开发者 https://www.devze.com 2023-01-17 12:21 出处:网络
i want to use the order by catid... but i need to use i开发者_如何学Ct on the 2 letter of the catid field

i want to use the order by catid... but i need to use i开发者_如何学Ct 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号