我需要使用 join 2 table 显示所有数据。
考试
表接触
numCode | fullName
00001 | Midna
00002 | Klog
00003 | Porla
00004 | Seka
00005 | Mila
表日期文件
numCode | dateCurr
00001 | 2012-10-29 00:00:00.000
00002 | 2012-10-29 00:00:00.000
00005 | 2012-10-29 00:00:00.000
代码 Sql 服务器
SELECT df.numCode as 'numCode', tf.dateCurr as 'dateCurr'
FROM dateFile df Full Outer join Contact ct On ct.numCode = df.numCode
WHERE df.dateCurr = '2012-10-29'
输出
numCode | dateCurr
00001 | 2012-10-29 00:00:00.000
00002 | 2012-10-29 00:00:00.000
00005 | 2012-10-29 00:00:00.000
但我需要输出得到:
numCode | dateCurr
00001 | 2012-10-29 00:00:00.000
00002 | 2012-10-29 00:00:00.000
00003 | 2012-10-29 00:00:00.000 (Insert Date from choose datetime)
00004 | 2012-10-29 00:00:00.000 (Insert Date from choose datetime)
00005 | 2012-10-29 00:00:00.000