SQL - Filtering WHERE condition on two rows
I received the following question a couple of days ago from a programmer using the “Ask a Question” form which you can access from the menu of this blog:
Given the following table:
| Name | Language |
| Nikhil | Hindi |
| Nikhil | English |
| Kisu | Hindi |
| Kisu | English |
| Rakesh | Hindi |
| Kousik | Bangali |
How do I select names of persons who know both Hindi and English?
In this table, that query should return Nikhil and Kisu.
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Last week I had an interesting assignment: Given a specific record, randomly retrieve three related records from the database.
One of the things it took me a while to figure out was how to get a stored procedure to loop through data in a table and pull out specific data I needed.
You may think that you don’t need a temporary table. But if you’ve ever retrieved data from your database or retrieved data from a table and put it in a list of some sort simply to process it further with your code, you need to learn about temporary tables.