我对sql有一个简单而愚蠢的疑问。我必须写下如下查询。在这里,id 不是唯一的。但是当我执行以下查询时,我会得到唯一值作为输出。我如何获得多个值?
select name from students_table where id in (select id from students_id);
Ex : Lets say students_table has name id
----- ---
john 1
jack 2
And students_id table has id
---
1
1
1
2
...
If i write the query in the above way i get name
----
john
jack
Instead i want my output as name
----
john
john
john
jack