Bonjour le forum;
j'ai une table contract et une table licenciement je souhait faire une requête qui m'affiche la liste des contract s'il n'existe pas dans la table licenciement
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
CREATE TABLE [dbo].[contrat](
	IdEmployer [int] IDENTITY(1,1) NOT NULL,
	[Matricule] [varchar](60) NULL,
	[Nom] [varchar](300) NOT NULL,
	[sexe] [varchar](1) NOT NULL,
	[dateNaissance] [datetime] NULL,
	[daterecrutement] [datetime] NULL,
	[datefincontrat] [datetime] NULL,
	[Dateretraite] [datetime] NULL,
	[lieu] [varchar](60) NULL,
	[CNI] [varchar](60) NOT NULL,
	[cnps] [varchar](60) NOT NULL,
	[pere] [varchar](60) NULL,
	[mere] [varchar](30) NULL,
	[Nationalite] [varchar](60) NOT NULL,
	[contact] [varchar](60) NOT NULL,
	[Mail] [varchar](60) NULL,
	[photo] [image] NULL,	
	[Idtypeemploi] int foreign key references typeemploi([Idtypeemploi]) NOT NULL,
	[Idcategorie] int foreign key references categorie([Idcategorie]) NOT NULL,
	[IdEntite] int foreign key references Entite([IdEntite]) NOT NULL,
	[Idcontrat] int foreign key references typecontrat([Idcontrat]) NOT NULL,
	[IdDepartement] int foreign key references Departement([IdDepartement]) NOT NULL,
	[IdPoste] int foreign key references poste([IdPoste]) NOT NULL,
	[IdSituationFamilial] int foreign key references SituationFamilial([IdSituationFamilial]) NOT NULL,
	[IdAgences] int foreign key references Agencesdaffectation([IdAgences]) NOT NULL,
	[IdUtilisateur] int foreign key references UTILISATEUR([IdUtilisateur]) NOT NULL,
	IdModepaiement int foreign key references Modepaiement(IdModepaiement) not null,
PRIMARY KEY CLUSTERED 
(
	[IdEmployer] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
--------------------------------------------------------Licenciement---------------------------------------------
create table Licenciement
(
IdTLicenciement int identity(1,1) primary key not null,
   Dates date not null,
[IdEmployer] int foreign key references [dbo].[contrat]([IdEmployer]) not null,
IdTypelicenciement int foreign key references Typelicenciement(IdTypelicenciement) not null,
Preavis nvarchar(250),
Observation nvarchar(250),
Montant decimal(18,6)
)
pouvez me proposer une solution car avec les conditions de jointures je ne parviens pas?