Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Need to exclude some rows in load, like
where not
(companykey=1 and monthkey >=201201) or
(companykey=2 and monthkey >=201206)
But it seems not to work.
Any idea how to do it?
br, timo v
This seems to work :
Where
not (
(companykey=1 and monthkey >=201201) or
(companykey=2 and monthkey >=201206)
);
some sample data would help
Hello Ioannis,
Here's an example
compkey mthkey amount
1 201101 100
1 201102 110
1 201103 120
1 201104 130
1 201105 140
1 201106 150
1 201107 160
1 201108 170
1 201109 180
1 201110 150
1 201111 130
1 201112 120
1 201201 110
1 201202 130
1 201203 140
1 201204 150
1 201205 160
1 201206 100
Where rows >=201201 should be excluded in load, and the same for an othet customer with an other time period
br
timo v
This seems to work :
Where
not (
(companykey=1 and monthkey >=201201) or
(companykey=2 and monthkey >=201206)
);
I think you could use Ioannis solution or:
where not
(companykey=1 and monthkey >=201201) and not
(companykey=2 and monthkey >=201206)
Regards
sorry for deleay, thx this worked
timo v