|
I have my business-logic in ~3000 lines of T-SQL stored procedures, and most of them has next approach:
SELECT A.A, B.B, C.C FROM aaa AS A, bbb AS B, ccc AS C -- here is what I called multi-table WHERE A.B = B.ID AND B.C = C.ID AND C.ID = @param
Will ...
Started by abatishchev on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
The two queries are equal - the first is using non-ANSI JOIN....
They should be equal.
With this particular query, but there are a few circumstances where the older outer join syntaxExecute both and check their query plans.
|
|
I have two tables:
Patient
pkPatientId FirstName Surname PatientStatus
pkPatientStatusId fkPatientId StatusCode StartDate EndDate Patient -> PatientStatus is a one to many relationship.
I am wondering if its possible in SQL to do a join which returns...
Answer Snippets (Read the full thread at stackoverflow):
BY ps.fkPatientId, ps.StartDate) as rownumber FROM Patient p INNER JOIN PatientStatus ps, ps.StatusCode, ps.StartDate, ps.EndDate FROM Patient p INNER JOIN PatientStatus ps ON p.pkPatientId, ps.StartDate, ps.EndDate FROM Patient p INNER....
|
|
Hi, guys, how or where is the "join" query in Django?
i think that Django dont have "join"..but how ill make join?
Thanks
Started by Asinox on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
SQL Join queries are a hack because.
Look into model relationships and accessing related objects.
|
Ask your Facebook Friends
|
Are there any performance issues if an sql query contains lot of joins?
Started by jayaprakashbr on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Read more in this article
Performance....
join book on book.bookid=chapter.bookid where chapter.subject='penguins'
The query would probably readOne of the best ways to boost JOIN performance is to limit how many rows need to be JOINed.
|
|
Hi is it possible to convert this sub query to a join ?
SELECT staff_no FROM doctor WHERE NOT EXISTS (SELECT * FROM patient WHERE staff_no = consultant_no);
Started by Ben on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
LEFT JOIN....
NOT EXISTS vs.
See this article in my blog for comparison of three methods to do this query in MySQL :
NOT IN vs.
SELECT staff_no FROM doctor LEFT JOIN patient ON staff_no = consultant_no WHERE consultant in your WHERE clause.
|
|
In general what makes an SQL query optimiser decide between a nested loop and a hash join.
Started by cindi on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
For a query like this:
SELECT * FROM a JOIN b ON b.b1 = a.a1 WHERE = condition in the ON clause)
HASH JOIN is the fastest method if all (or almost all) records should from a and uses the value....
Be used to limit the number of records.
|
|
Can someone help me understand what's wrong with this query:
DELETE FROM noteproject INNER JOIN note ON noteproject.noteID = note.noteID INNER JOIN person ON note.personID = person.personID WHERE noteID = '#attributes.noteID#' AND personID = '#attributes...
Started by nobosh on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
I have no db at the moment to test what I'm tables that are used only for searching:
1)... .
Alternatively, you can write:
DELETE FROM noteproject USING noteproject INNER JOIN ...
Should be:
DELETE noteproject FROM noteproject INNER JOIN ...
|
|
Hi, i'm trying to join 8 tables into one in order to create index used by other application, my query is like : (my mysql skill's very amateur)
SELECT t1_id, t2_name, t3_name, t4_name, t5_name, t6_name, t7_name, t8_name, t9_name FROM t1 LEFT JOIN t2 ON...
Started by lordlinier on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
But, first of all, you have indexes on all the fields used in the join? something like CREATE INDEX ix_t2_id on t2 (t2_id, t2_name t9_name from t9 where t1_id = t9_id) ....
It would help a bit if you could post the explain plan of the query.
|
|
I have a table called orders. one column on order is customer_id
i have a table called customers with 10 fields
Given the two options if i want to build up an array of order objects and embedded in an order object is a customer object i have two choices...
Started by oo on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
A join would be optimized inside the DBMS using the query optimizer so will be faster thanThe single join....
query that joins these 10 tables or at some point is it inefficient
All these tables join query.
|
|
My supervisor told me this query will 'crash the server' (because it has millions of tables i believe). Can anyone tell me WHY? maybe show me the way i am suppose to do it? I am currently reading manuals to figure this out.
What i was told is these joins...
Started by An employee on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
It may make sense to keep a column in more a report (can't think of many other outputs where you'd want so many columns), how often does this query tables and load it into ....
Not have to join so many tables together to get what they need.
|