I have a table with clients and I'm trying to create a query which returns all the persons who have the same address as -say- John.
example
Name Address
John 22 Acacia Avenue
Mary 22 Acacia Avenue
Leo 12 Nowhere street
Jake 22 Acacia Avenue
Cindy 43 Leeds street
Tom 78 Abbey Road
So, by looking for John, I'd get as a result
Name Address
John 22 Acacia Avenue
Mary 22 Acacia Avenue
Jake 22 Acacia Avenue
I hope that's clear enough. I'm using SQLite 3.33 , thanks!
You can do this using a subquery.
select *
from people
where address = (
select address
from people
where name = 'John'
)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments