So there are 2 tables in my database.
staff:
name age mail
John 20 john@john.john
Robert 25 robert@robert.robert
customers:
name age mail
Bob 21 bob@bob.bob
Mara 20 mara@mara.mara
Trisha 20 trisha@trisha.trisha
Melina 23 melina@melina.melina
If I want to select everything from customers where age is 20 I use this:
extracting = mydb.execute("SELECT * FROM customers WHERE age = '20'")
20s_users = extracting.fetchall()
for i in 20s_users:
print(i)
And the output in python is
('Mara', '20', 'mara@mara.mara')
('Trisha, '20', 'trisha@trisha.trisha')
But I want to select this thing from BOTH tables and combine them...
What query command should I use in order for my output to be:
('John' '20' 'john@john.john')
('Mara', '20', 'mara@mara.mara')
('Trisha, '20', 'trisha@trisha.trisha')
question from:https://stackoverflow.com/questions/65907119/query-2-similar-tables-sqlite