03-04-2014 2:56 PM
Hi All,
Could you please check whether the attached select statement syntax is appropriate.
I have notification ID in the where clause so should I add the VIQMEL table in the FROM clause or is this fine - I am getting the values correctly.
03-04-2014 3:28 PM
You are getting the desired result, VIQMEL is already included (two lines below the commented out line, otherwise there would be a syntax error), so what is the issue?
Nice join, by the way
Thomas
03-04-2014 3:28 PM
You are getting the desired result, VIQMEL is already included (two lines below the commented out line, otherwise there would be a syntax error), so what is the issue?
Nice join, by the way
Thomas
03-04-2014 3:38 PM
The join will even be "nicer" if you "explode" VIQMEL which is a database view with three tables QMIH, QMEL and ILOA, into its three components.
Regards,
Raymond
03-04-2014 4:35 PM
03-04-2014 7:07 PM
Hello John,
It is very good that you used INNER JOINS instead of FOR ALL ENTRIES.
Appreciate your work. Maintain the same.
INNER JOIN looks fine and make sure that you used the fields in the order as it is appearing in the table, I mean the same index as in the tables.
Regards,
Thanga
03-04-2014 7:36 PM
Thanga Prakash wrote:
... and make sure that you used the fields in the order as it is appearing in the table, I mean the same index as in the tables.
I assume you mean the ON- and WHERE-conditions. Please note that this is also a myth.
The order of the fields does not matter, presence or absence of fields does matter (a lot).
If you have an index with fields A, B and C in that order, you might as well write ... WHERE C = ... AND B = ... AND A = ...
Compare yourself with an example program if in doubt.
Thomas
03-04-2014 7:46 PM
Hello Thomas,
Thanks for the explanation, will check it. Also can you please give me some points on how to increase the performance of INNER JOINS.
Regards,
Thanga
03-04-2014 7:53 PM
The most important thing:
Make sure all ON- and WHERE-conditions make effective use of the primary or a secondary index of the involved tables.
"Effective" means having EQ-conditions for as many fields of that index as possible, top down without gaps.
Thomas
03-04-2014 7:58 PM
Hello Thomas,
Even I meant to say the same in my last line of the statement, to use Index. Might be i have not used correct sentence to convey it.
Regards,
Thanga
03-04-2014 8:38 PM
make sure that you used the fields in the order as it is appearing in the table
What did you want to convey here? The same order as they appear in the index, is it?
03-04-2014 8:50 PM
Hello Suhas,
I mean to say try to use the index available in those tables.
Regards,
Thanga
03-04-2014 7:16 PM
03-04-2014 7:54 PM