Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another SQL Server 2000 Query Conundrum
Message
 
À
24/07/2007 11:12:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01243142
Message ID:
01243191
Vues:
26
>Got it working! :o) *GGGGGGGG* with the following two changes:
>
>SELECT * from table3 as vh
> INNER JOIN (SELECT tw.* from table1 as tw...
>
>which is almost identical and makes no sense to me, but it returns the correct results. Yahoo! Thanks, thanks, thanks!
>

I'm glad you got it work, but that is strange to me because I tested it that way:
DECLARE @Table3 TABLE (vehi_id Int)
DECLARE @Table2 TABLE (inci_id varchar(14), parent_id varchar(14))
DECLARE @Table1 TABLE (veh_id Int, inci_id varchar(14), canccode varchar(20))


SELECT * from @table3 as vh
 inner join  (SELECT tw.veh_id, qry1.* FROM @table1 tw
                     INNER JOIN (SELECT table2.* FROM @table2 table2
                                        WHERE  table2.inci_id = '07000244      '
                                            or table2.inci_id = '2007093878    '
                                            or table2.parent_id = '07000244      '
                                            or (LEN(table2.parent_id)>0 AND table2.parent_id = '2007093878    ')) qry1
                     ON tw.inci_id = qry1.inci_id WHERE canccode='    ') qry2
on vh.vehi_id = qry2.veh_id
and no error happens.
(of course no result also, but the there should be errors if something is wrong.
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