You would use an INNER
join to establish the relationship between the common gameid
field;
select
votes.userid,
games.title
from games
inner join votes on (votes.gameid = game.gameid)
where
votes.userid = 'a'
More Related Contents:
- What is semi-join in database?
- Decrease salary using a SQL query
- I need help formatting inner join command in SQL query
- Reason for Column is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause [duplicate]
- Sort by column ASC, but NULL values first?
- Search All Fields In All Tables For A Specific Value (Oracle)
- Using an Alias column in the where clause in Postgresql
- How to get next/previous record in MySQL?
- SQL best practice to deal with default sort order
- ORA-12560: TNS:protocol adaptor error
- How to Create a real one-to-one relationship in SQL Server
- Select statement to find duplicates on certain fields
- How to use DISTINCT and ORDER BY in same SELECT statement?
- Getting only Month and Year from SQL DATE
- How does GROUP BY work?
- Linq version of SQL “IN” statement
- What is a self join for? (in english)
- Check for file exists or not in sql server?
- How to ORDER BY a SUM() in MySQL?
- How to create a PivotTable in Transact/SQL?
- Alternate of lead lag function in SQL Server 2008
- SQL – Select first 10 rows only?
- SQL – Inserting a row and returning primary key
- How do I start auto increment from a specific point?
- How to search SQL column containing JSON array
- How to use a dynamic parameter in a IN clause of a JPA named query?
- Perform regex (replace) in an SQL query
- Why doesn’t Oracle SQL allow us to use column aliases in GROUP BY clauses?
- Determine if one coordinate is in radius of another
- Entity Framework Skip/Take is very slow when number to skip is big