Questions tagged [inner-join]

A database operation that combines the values of 2 tables based on a condition, or relationship, that exists between those tables.

Filter by
Sorted by
Tagged with
5049votes
27answers
2.5mviews

What is the difference between "INNER JOIN" and "OUTER JOIN"?

Also how do LEFT JOIN, RIGHT JOIN and FULL JOIN fit in?
user avatar
2010votes
3answers
1.9mviews

What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN? [duplicate]

What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN in MySQL?
user avatar
  • 30.7k
1575votes
16answers
1.8mviews

How can I delete using INNER JOIN with SQL Server?

I want to delete using INNER JOIN in SQL Server 2008. But I get this error: Msg 156, Level 15, State 1, Line 15 Incorrect syntax near the keyword 'INNER'. My code: DELETE FROM WorkRecord2 INNER ...
user avatar
  • 16.3k
1243votes
6answers
767kviews

Difference between JOIN and INNER JOIN

Both these joins will give me the same results: SELECT * FROM table JOIN otherTable ON table.ID = otherTable.FK vs SELECT * FROM table INNER JOIN otherTable ON table.ID = otherTable.FK Is there ...
user avatar
  • 156k
1051votes
12answers
664kviews

INNER JOIN ON vs WHERE clause

For simplicity, assume all relevant fields are NOT NULL. You can do: SELECT table1.this, table2.that, table2.somethingelse FROM table1, table2 WHERE table1.foreignkey = table2.primarykey ...
user avatar
  • 15.2k
404votes
2answers
890kviews

SQL Server - inner join when updating [duplicate]

I have the below query which does not work. What am I doing wrong? Is this even possible? UPDATE ProductReviews AS R INNER JOIN products AS P ON R.pid = P.id SET R.status = '0' WHERE R....
user avatar
  • 5,989
375votes
12answers
1.5mviews

SQL Inner-join with 3 tables?

I'm trying to join 3 tables in a view; here is the situation: I have a table that contains information of students who are applying to live on this College Campus. I have another table that lists the ...
user avatar
  • 4,267
348votes
15answers
907kviews

Update statement with inner join on Oracle

I have a query which works fine in MySQL, but when I run it on Oracle I get the following error: SQL Error: ORA-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly ...
user avatar
  • 3,887
142votes
11answers
268kviews

MySQL INNER JOIN select only one row from second table

I have a users table and a payments table, for each user, those of which have payments, may have multiple associated payments in the payments table. I would like to select all users who have payments, ...
user avatar
  • 4,559
136votes
3answers
229kviews

SQL DELETE with INNER JOIN

There are 2 tables, spawnlist and npc, and I need to delete data from spawnlsit. npc_templateid = n.idTemplate is the only thing that "connect" the tables. I have tried this script but it doesn't work....
user avatar
  • 1,453
119votes
3answers
173kviews

How to use mysql JOIN without ON condition?

Is it possible to write join query without ON statement? and how do these joins differ LEFT JOIN, RIGHT JOIN works.
user avatar
  • 1,301
118votes
3answers
146kviews

Is having an 'OR' in an INNER JOIN condition a bad idea?

In trying to improve the speed of an immensely slow query (several minutes on two tables with only ~50,000 rows each, on SQL Server 2008 if it matters), I narrowed down the problem to an OR in my ...
user avatar
  • 12.6k
76votes
4answers
97kviews

Difference in MySQL JOIN vs LEFT JOIN

I have this cross-database query... SELECT `DM_Server`.`Jobs`.*, `DM_Server`.servers.Description AS server, digital_inventory.params, products....
user avatar
  • 57.9k
76votes
10answers
373kviews

SQL Inner join more than two tables

I can currently query the join of two tables on the equality of a foreign/primary key in the following way. $result = mysql_query("SELECT * FROM `table1` INNER JOIN ...
user avatar
  • 6,544
76votes
2answers
85kviews

Why does Pandas inner join give ValueError: len(left_on) must equal the number of levels in the index of "right"?

I'm trying to inner join DataFrame A to DataFrame B and am running into an error. Here's my join statement: merged = DataFrameA.join(DataFrameB, on=['Code','Date']) And here's the error: ...
user avatar
  • 909

15 30 50 per page
1
2 3 4 5
420