Additional SQL Server features and topics not covered by specific categories
Why do you JOIN on column "LoginTimestamp"? If LoginTimestamp changes the JOIN fails and returns the customer again; remove it.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hello,
I would like to return all rows from "Logins" which are not present in "tbl_LoginIdCount"
It's just that I run this once and insert into compute."tbl_LoginIdCount"
but then when I run the same query again the select still returns the same rows and does not see tha tthose rows are already in tbl_LoginIdCount
select
CURRENT_DATE , count(fl."LoginId"), fl."LatestCode"
from
"Logins" as fl
left join "tbl_LoginIdCount" as lc on date(fl."LoginTimestamp") = lc."Date" and fl."LatestCode" = lc."Code"
WHERE
lc."Date" is NULL and lc."Code" is null
group by
fl."LatestCode";
Additional SQL Server features and topics not covered by specific categories
Answer accepted by question author
Why do you JOIN on column "LoginTimestamp"? If LoginTimestamp changes the JOIN fails and returns the customer again; remove it.