I have 2 tables in my database. Users and Profiles. Users has the following columns UserID(Primary Key), Email, Phone, Password, AccountVerified and Profiles has the following columns ProfileID(Primary Key), Username, Firstname, Lastname, Gender, Age, Role, ProfilePicture, UserID(Foreign Key). When I make the SQL query:
SELECT *
FROM "Users"
INNER JOIN "Profiles" ON "Users.UserID" = "Profiles.UserID";
I get the error message:
column "Users.UserID" does not exist.
So I tried to run the query:
SELECT "UserID" FROM "Users";
and it returns the result successfully.
If you write "Users.UserID"
, that is a single identifier in SQL. To use a double quoted schema name, and a double quoted table name, use "Users"."UserID"
.