Hi, I'm back here with new simple question, but since I'm noob at SQL, so I can't answer this myself.
assumption I have 2 table, Table 1 (10000 rows) is data raw having lot of infomation of bill, and table 2 (10 rows) content client-to-tracking infomation. Those 2 table have connect by ID.
when I use query, set relationship to left join
(all from table 2 and match from table 1),
the result show less record than number of table 2's record
(4 rows for example)
where is the rest record ? i don't expect left join having this result, I try to change relationship to innerjoin or right join have no different.
need to show up 10 rows in query to tracking... I can't miss even 1 row
I use some total (group by, expression, where...) on design.
code like this:
assumption I have 2 table, Table 1 (10000 rows) is data raw having lot of infomation of bill, and table 2 (10 rows) content client-to-tracking infomation. Those 2 table have connect by ID.
when I use query, set relationship to left join
(all from table 2 and match from table 1),
the result show less record than number of table 2's record
(4 rows for example)
where is the rest record ? i don't expect left join having this result, I try to change relationship to innerjoin or right join have no different.
need to show up 10 rows in query to tracking... I can't miss even 1 row
I use some total (group by, expression, where...) on design.
code like this:
Code:
SELECT [Table 2].Ter, [Table 2].ID, [Table 2].name, [Table 2].voltarget, Sum([Table 1].[volume]) AS [Total-MTD], IIf([Total-MTD]>=[voltarget],"yes”,"No") AS [Success (y/n)] FROM [Table 2] LEFT JOIN [Table 1] ON [Table 2].ID = [Table 1].ID WHERE ((([Table 1].[Item code]) Like "116*")) GROUP BY [Table 2].Ter, [Table 2].ID, [Table 2].name, [Table 2].ID;
Comment