hello friends...
i have two table as follows
Table name : Pds_1
valid empcode shift edatetime solid gplsolid
1 u1 B 2014-08-01 10:23:00.000 25.00000 32.00000
2 u1 B 2014-08-01 10:25:00.000 36.00000 98.00000
3 u1 A 2014-08-01 10:30:00.000 2.00000 65.00000
4 u1 A 2014-08-01 10:24:00.000 23.00000 654.00000
5 u1 C 2014-08-01 10:45:00.000 5.00000 4.00000
6 u1 C 2014-08-01 10:55:00.000 5.00000 4.00000
Table Name : Pds_2
valid emp shift edatetime slurrydensity caustic ratio
1 u1 C 2014-08-01 10:24:00.000 5.00000 6.00000 7.00000
2 u1 C 2014-08-01 10:25:00.000 5.00000 2.00000 54.00000
3 u1 B 2014-08-01 01:34:00.000 5.00000 6.00000 5.00000
4 u1 A 2014-08-01 08:35:00.000 6.00000 5.00000 4.00000
and i want to get all entries from pds_1 and pds_2 tables. i used full outer join as follows
select p1.shift as p1,p1.gplsolid,p1.solid,
p2.shift as p2,p2.caustic,p2.ratio,p2.slurrydensity from pds_1 p1 full outer join pds_2 p2
on p1.shift = p2.shift
where CONVERT(varchar,p1.edatetime,103) in (convert(varchar,@date,103))
and CONVERT(varchar,p2.edatetime,103) in (convert(varchar,@date,103))
but it gives repeated row that i don't want
PDS
"Wagon Bauxite
% Moisture" "Ball Mill Feed
+1 inch
Max:15%" "Ball Mill Feed
Moist
%" "Ball Mill Product
TPH
m3/hr" "Ball Mill Product
Ball Mill No." "Ball Mill Product
% Solid" "Ball Mill Product
Density"
C 4.00 5.00 C 6.00 7.00 5.00
C 4.00 5.00 C 2.00 54.00 5.00
C 4.00 5.00 C 6.00 7.00 5.00
C 4.00 5.00 C 2.00 54.00 5.00
B 32.00 25.00 B 6.00 5.00 5.00
A 65.00 2.00 A 5.00 4.00 6.00
B 98.00 36.00 B 6.00 5.00 5.00
A 654.00 23.00 A 5.00 4.00 6.00