Linked Questions

29 votes
5 answers
77k views

I'm experiencing a very confusing situation that makes me question all my understanding of joins in SQL Server. SELECT t1.f2 FROM t1 LEFT JOIN t2 ON t1.f1 = t2.f1 AND cond2 AND t2.f3 > ...
Kamel Keb's user avatar
  • 393
20 votes
1 answer
80k views

Is there a difference between doing something like SELECT * FROM table1 INNER JOIN table2 ON table2.ObjectId = table1.table2ObjectId WHERE table2.Value = 'Foo' vs SELECT * FROM table1 INNER JOIN ...
Arizona1911's user avatar
  • 2,201
2 votes
2 answers
839 views

I always assumed that a statement of the following form SELECT * FROM A LEFT JOIN B ON (A.column1 = B.column2 AND B.column2 = 12321) is always equivalent to SELECT * FROM A LEFT JOIN B ON (A....
mathtec's user avatar
  • 201
2 votes
3 answers
192 views

Is there any difference in prepared query structure and thence performance, between select * from employee e join division d on e.eid = d.eid and e.div = d.div and e.level > 5 and ...
Blessed Geek's user avatar
  • 21.8k
0 votes
2 answers
1k views

When doing an SQL query, is there any significant (or any at all) difference in performance between 'WHERE' and 'ON'? I know there is a significant difference in the resulting set between the two ...
user2272044's user avatar
0 votes
3 answers
452 views

When using JOINS we have the choice of using either the WHERE clause and the OR clause. Question: is there a performance difference between these two? Should one be used over the other? What is the ...
polymorph's user avatar
-1 votes
2 answers
721 views

What's the difference between select t.*, a.age from t left join a on t.ID = a.ID and a.column > 10 and select t.*, a.age from t left join a on t.ID = a.ID where a.column > 10 ? Specifically, ...
doremi's user avatar
  • 171
0 votes
2 answers
130 views

I have two update statements. Both of them gives the same output. How they are different and which is better to use? Statement 1: UPDATE li SET li.Description = im.Description FROM ...
Madhukar's user avatar
  • 1,242
0 votes
4 answers
258 views

Way1: Select * from tableA inner join tableB on tableA.aid = tableB.aid where a.condA = xx AND a.condB = xx AND a.condC = xx Way2: Select * from tableA inner join tableB on tableA.aid = tableB.aid ...
SuicideSheep's user avatar
  • 5,610
0 votes
2 answers
124 views

Possible Duplicate: SQL join: where clause vs. on clause What are the difference between of following table joining ways and which one is more appreciate for query optimization. SELECT SP.*, S....
AKZap's user avatar
  • 1,211
1 vote
1 answer
116 views

Let us suppose we have a join between t1 and t2, like this: select c1, ..., cn from t1 join t2 on t1.fk = t2.k join t3 on t2.fk = t3.k where (some condition independent from t3) where (some condition ...
Lajos Arpad's user avatar
  • 80.4k
-4 votes
1 answer
111 views

SELECT r.region_name as Region, COUNT(o.*) AS CanCount FROM region AS r INNER JOIN orders AS o ON o.region_id = r.region_id WHERE r.region_id = 1 SELECT [Region] = r.region_name , [...
SoundSpace's user avatar
1 vote
0 answers
38 views

I ask myself what is the more performance method when you join table and use JOIN in clause FROM and when you need to use BETWEEN : Use Between in the FROM or Use between in the WHERE Exemple : ...
Maxime Pavy's user avatar
0 votes
0 answers
28 views

I have a query that was performing slowly that looked something like this: DECLARE @TeamId INT = 123 ... SELECT ... FROM Player p LEFT JOIN PlayerTeam pt ON p.PlayerId = pt.PlayerId ... WHERE pt....
jausel's user avatar
  • 615
0 votes
0 answers
15 views

I have two tables A id, b_id and B id, arbitrary_binary_value arbitrary_binary_value is really a field that is 1 or 0, each otherwise unique row is duplicated with a 1 and a 0, this is just some db I ...
amchugh89's user avatar
  • 1,316

15 30 50 per page
1
2 3 4 5
7