我正在尝试列出具有 2 列的多表查询的结果。我有我需要的正确数据,我只需要将其缩减为 1 行结果。换句话说,消除结果中的重复条目。我正在使用此处未显示的值 school_id。我应该把它作为一个独特的价值吗?我可以在不显示 school_id 的情况下这样做吗?
SQL> select DISTINCT(school_name),Team_Name
2 from school, team
3 where team.team_name like '%B%'
4 AND school.school_id = team.school_id;
SCHOOL_NAME TEAM_NAME
-------------------------------------------------- ----------
Lawrence Central High School Bears
Lawrence Central High School BEars
Lawrence Central High School BEARS