Skip to content
Advertisement

SQL Query: Join (or select) 2 columns from 1 table with 1 column from another table for a view without extra join columns

This is my very first Stackoverflow post, so I apologize if I am not formatting my question correctly. I’m pounding my head against the wall with what I’m sure is a simple problem. I have a table with a bunch of event information, about 10 columns as so:

Table: event_info

And another table with user information:

Table: users

I want to create a view that has only a subset of the information, not full table joins. The event table lead_user_id and colead_user_id columns both refer to the user_id column in the users table.

I want to create a view like this:

I have tried the following and several iterations like it to no avail…

And I get the dreaded

You have an error in your SQL Syntax

message. I’m not surprised, as I’ve really only ever used joins on single columns or nested select statements… this two columns pointing to one is throwing me for a loop. Help!

Advertisement

Answer

correct query for this matter

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement