Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Insert with 2 primary keys in xref table
Message
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:
Visual FoxPro
Divers
Thread ID:
01265745
Message ID:
01265761
Vues:
7
Sergey,
it's amazing what happens when you have to explain something in detail to someone else. The problem becomes very clear in your own mind. I just realized my logic was wrong.
Thanks


>John,
>
>It's not clear what you're trying to do and your query doesn't make any sense. Can you elaborate?
>
>>I have a cross reference table attaching the employee deduction types table to employees. I need a SQL insert to update this table. The code below crashes because you can't use IN (SELECT...) more than once in a query (I assume). Anyone want to take a crack at it?
>>
>>
* Add any missing deduction types for each employee.
>>TEXT TO mSqlCommand noshow pretext 15 TEXTMERGE
>>  insert into <<xfprdedemp>>
>>  (k_prempl, k_prdedmst)
>>  select k_prempl, k_prdedmst
>>  from prdedmst
>>  where prdedemp.k_prempl not in (select k_prempl from prdedmst)
>>  and prdedemp.k_prdedmst not in (select k_prdedmst from prdedmst)
>>ENDTEXT
>>&mSqlCommand
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform