如何列出所有姓氏相同的乐队成员的姓名?
该列的值如下所示:
band_NAME
-------------------
Carla Thomas
Stephen E. Rice
Cynthia P. Tree
Richard Anthony Paul
Ann Frances Smith
Lorace Black
Timothy Adam Paul
我知道我们需要使用
instr
和substr
。我只是不明白如何确定位置。我知道基本格式会像这样:
SELECT band_NAME
FROM TABLE
where substr(band_name, ?, instr( ) IN
(select substr(band_name, ?, instr( )-1)
from table
group by SUBSTR(band_NAME , ?, INSTR( )-1 )
HAVING COUNT(* ) > 1 );
但是问题是什么?在instr
里面填什么?
非常感谢您的帮助!