我从数据库中选择几行,例如:
select * from student where name is like %ram%
Run Code Online (Sandbox Code Playgroud)
结果:
ID Name email Branch
7 rama rama@gmail.com B1
5 ramb ramb@gmail.com B2
3 ramc ramc@gmail.com B3
8 ramd ramd@gmail.com B4
11 rame rame@gmail.com B5
12 ramf ramf@gmail.com B6
14 ramg ramg@gmail.com B7
Run Code Online (Sandbox Code Playgroud)
我需要得到哪个分支是B5的行号.预期值为"5"
有人可以建议如何在查询中实现这一点?