Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help to build a query
Message
 
 
À
03/11/2008 11:38:17
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01359198
Message ID:
01359205
Vues:
27
Try
SELECT tb1.username, tb2.username
  FROM tablea ta 
    JOIN tableb tb1 ON ta.idrespg = tb1.iduser 
    JOIN tableb tb2 ON ta.idrespp = tb2.iduser 
>I have two tables (A and B) and in Table A there are to fields (IDRespG and IDRespP varchar(13) both) and in table B I have the IDUser (varchar(13)) and UserName
>
>TABLE A:
>IDRESPG IDRESPP
>22222222 11111111
>11111111 73161768
>
>TABLE B:
>
>IDUSER USERNAME
>11111111 Peter G
>22222222 Charles D
>73161768 Vicky B
>
>So, the output should be:
>
>Charles D Peter G
>Peter G Vicky B
>
>How can I do this?
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform