I have a simple and silly doubt in sql. I have to write down a query like the one below. Here, id is not unique. But when i do the following query i get unique values as output. How do i get multiple values?
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