Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fine tuning a SPROC
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01234693
Message ID:
01234846
Vues:
14
>>>I replaced my LEFT OUTER JOIN with INNER JOIN, and the query took only 8 seconds this time.
>>>
>>>LEFT JOIN can always be replaced with INNER JOIN and a UNION. Did both INNER JOINS table1->table2 and table2->table1 work the same?
>>
>>
>>I'm not sure, but that comment doesn't ring true to me. Can you provide an example test to show me what you mean?
>
>http://www.sql-server-performance.com/transact_sql.asp
>
>select table1.*, table2.* from table1 inner join table2 on ...
>union ;
>select table1.*, cast("" as c(50)) as field2, ... from table1 && rest of records from table1 what don't have table2 matching records
Why I see VFP code here
cast("" as c(50))
must be
cast('' as char(50)) or
cast("" as varchar(50)) or simply
''

:-)))
and BTW you need LEFT JOIN for the second select just to add where clause so you could filter records from table1 which doesn't exist in table2.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform