Sql
K!
-
Nettogrof Messages postés 522 Statut Membre -
Nettogrof Messages postés 522 Statut Membre -
Bonjour,
Voilà j'ai 8 requêtes très semblables mais sur des tables différentes. Je voudrais pouvoir former une seule requête avec ces 8 requêtes. En fait c'est pour pouvoir faire un group by par la suite et les avoir tt bien rangé ds mon fichier de sortie.
Voici mes requêtes:
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crc_v22 a, entete_crc b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crtpm_v22 a, entete_crtpm b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crtpp_v22 a, entete_crtpp b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crdep_v22 a, entete_crdep b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crder_v22 a, entete_crder b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crhb_v22 a, entete_crhb b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crpre_v22 a, entete_crpre b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crtit_v22 a, entete_crtit b where a.entite=b.entite ;
Help me please!
Merci d'avance
K!
Voilà j'ai 8 requêtes très semblables mais sur des tables différentes. Je voudrais pouvoir former une seule requête avec ces 8 requêtes. En fait c'est pour pouvoir faire un group by par la suite et les avoir tt bien rangé ds mon fichier de sortie.
Voici mes requêtes:
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crc_v22 a, entete_crc b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crtpm_v22 a, entete_crtpm b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crtpp_v22 a, entete_crtpp b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crdep_v22 a, entete_crdep b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crder_v22 a, entete_crder b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crhb_v22 a, entete_crhb b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crpre_v22 a, entete_crpre b where a.entite=b.entite ;
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crtit_v22 a, entete_crtit b where a.entite=b.entite ;
Help me please!
Merci d'avance
K!
A voir également:
- Sql
- Logiciel sql - Télécharger - Bases de données
- Requete sql pix ✓ - Forum MySQL
- Sql lister les tables ✓ - Forum Programmation
- Récupération serveur sql - Télécharger - Gestion de données
- Migration base access vers sql server - Télécharger - Gestion de données
2 réponses
Bon d'accord, c'est bourrin, mais:
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crc_v22 a, entete_crc b where a.entite=b.entite UNION select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crtpm_v22 a, entete_crtpm b where a.entite=b.entite UNION select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crtpp_v22 a, entete_crtpp b where a.entite=b.entite UNION select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crdep_v22 a, entete_crdep b where a.entite=b.entite UNION select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crder_v22 a, entete_crder b where a.entite=b.entite UNION select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crhb_v22 a, entete_crhb b where a.entite=b.entite UNION select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crpre_v22 a, entete_crpre b where a.entite=b.entite UNION select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation from crtit_v22 a, entete_crtit b where a.entite=b.entite ;
ou bein :
Espérant que ca va aider..... car c'est assez long
Nettogrof tseb era seiromem emoS
select distinct a.entite,b.code_class,a.cd_app2 , b.dtsituation, c.entite,d.code_class,c.cd_app2 , d.dtsituation,e.entite,f.code_class,e.cd_app2 , f.dtsituation,g.entite,h.code_class,g.cd_app2 , h.dtsituation, i.entite,j.code_class,i.cd_app2 , j.dtsituation,k.entite,l.code_class,k.cd_app2 ,l.dtsituation, m.entite,n.code_class,m.cd_app2 ,n.dtsituation,o.entite,p.code_class,o.cd_app2 , p.dtsituation from crc_v22 a, entete_crc b, crtpm_v22 c, entete_crtpm d, crtpp_v22 e, entete_crtpp f,crdep_v22 g, entete_crdep h, crder_v22 i, entete_crder j, crhb_v22 k, entete_crhb l, crpre_v22 m, entete_crpre n, crtit_v22 o, entete_crtit p where a.entite=b.entite and c.entite=d.entite and e.entite=f.entite and g.entite=h.entite and i.entite=j.entite and k.entite=l.entite and m.entite=n.entite and o.entite=p.entite Group by (???) ¨
Espérant que ca va aider..... car c'est assez long
Nettogrof tseb era seiromem emoS