Welcome Guest, Not a member yet? Register   Sign In
Help tuning a very poor SQL query
#9

[eluser]jedd[/eluser]
Quote:That said, is it technically possible to do any kind of JOINs even if the tables aren't named well, ie using AS to cast it to a different name for the query instance?

Of course .. you can cast any of those fields using an AS. That's the easy bit.

Quote:I got errors on that join and fiddled a bit but haven't got it yet.
Errors ...? Go on .. share them. Smile I don't have a set of tables with a suitably/ speculatively comparable set of data to test my calls against, so I've just dodgied something up. If you have a couple of short INSERT scripts, that'd be handy.

Quote:Also, I am trying to get all the rows, EXCLUDING the ones marked "1" in the kg_progress table, can I still use JOIN xxxxxx = 1 in that case or !=1 or do I need a different operand than JOIN?

Of course. Here's one of my nonsensical ones I was playing with earlier.
Code:
SELECT *
    FROM organism
    LEFT JOIN taxa_species ON taxa_species.id!=organism.taxa_species
    WHERE taxa_species.id=1
    AND organism.id=1;

Quote:I regret not having been more interested in MS Access in high school computer class Tongue

Your disregard of MS Access serves only to improve others' regard of you, I'm sure.


Messages In This Thread
Help tuning a very poor SQL query - by El Forum - 06-17-2009, 08:03 AM
Help tuning a very poor SQL query - by El Forum - 06-17-2009, 08:19 AM
Help tuning a very poor SQL query - by El Forum - 06-17-2009, 08:24 AM
Help tuning a very poor SQL query - by El Forum - 06-17-2009, 09:42 AM
Help tuning a very poor SQL query - by El Forum - 06-17-2009, 09:47 AM
Help tuning a very poor SQL query - by El Forum - 06-17-2009, 10:10 AM
Help tuning a very poor SQL query - by El Forum - 06-17-2009, 10:28 AM
Help tuning a very poor SQL query - by El Forum - 06-17-2009, 11:21 AM
Help tuning a very poor SQL query - by El Forum - 06-17-2009, 11:40 AM
Help tuning a very poor SQL query - by El Forum - 06-17-2009, 11:49 AM
Help tuning a very poor SQL query - by El Forum - 06-18-2009, 05:49 AM
Help tuning a very poor SQL query - by El Forum - 06-18-2009, 05:53 AM
Help tuning a very poor SQL query - by El Forum - 06-18-2009, 06:02 AM
Help tuning a very poor SQL query - by El Forum - 06-18-2009, 09:57 AM
Help tuning a very poor SQL query - by El Forum - 06-18-2009, 10:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB