Mon MS SQL Serverstored procedure est:Comment puis-je sélectionner aucune ligne dupliquée avec jointure interne?
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_close]
@DATE NVARCHAR(8)
AS
BEGIN
SELECT appointment_datas.appointment_date
,appointment_datas.appointment_no
,costumer_datas.costumer_name
,appointment_datas.appointment_type
,personel_datas.personel_ADI
FROM [LONI].[dbo].appointment_datas
INNER JOIN [LONI].[dbo].costumer_datas ON appointment_datas.appointment_costumer = costumer_datas.costumer_id
INNER JOIN [LONI].[dbo].personel_datas ON appointment_datas.appointment_personel = personel_datas.personel_id
INNER JOIN [GUONU].[dbo].dayend ON appointment_datas.appointment_no <> dayend.appointment_no COLLATE Turkish_CI_AS
WHERE CONVERT(nvarchar(8),appointment_datas.appointment_date,112) = @DATE
END
Avec ce code, je sélectionne les lignes en double les mêmes enregistrements. En fait, je veux sélectionner des champs de [LONI]. [Dbo] .appointment_datas mais si appointment_no est pas [GUONU]. [Dbo] .dayend
S'il vous plaît utiliser des espaces pour indenter votre code pour en faire un bloc de code. –
Apparemment, cela est allé en mode communautaire avec tout le monde le reformater: O – Andomar
@Andomar: Doit être une chose 10k? Je ne peux pas changer les questions à la communauté wiki ... –