SQL query beginner, obviously.
So I have 3 tables with data: Account, Owner, Vehicle.
These three are tied together with a common variable: "User_Name".
I want to get all items from these three tables where User_Name matches my search variable. So if i search for a user with User_Name: "Mike" all items from the three tables with the User_Name "Mike" will be displayed.
I have the following query using general "JOIN", but how can I change this to use a search variable to select ALL that match the variable from ALL tables?
cursor.execute("SELECT * FROM Account JOIN Owner ON(Account.User_Name = Owner.User_Name) JOIN Vehicle ON(Account.User_Name = Vehicle.User_Name)")
I have looked on various other Stack-threads about "select from multiple tables" but all of them only select from 2 tables and the ones that select from 3, doesn't have the variable match that I want.
So in short:
Search three tables and get all rows where a common column variable matches a search-string.