| Detta villkor är uppfyllt... |
...om denna SQL... |
...returnerar |
Kommentar |
| Finns det personer som har flera poster med samma BONR? |
with temp as (
select ddbid, bonr, count(*) antal
from k137.boort
group by ddbid, bonr
having count(*) > 1
)
Select count(*)
from temp
|
0 |
|
| Finns det personer som har BONR = 2 men saknar BONR = 1? |
with har_1 as (
select ddbid
from k137.boort
where bonr = 1
),
har_2 as (
select ddbid
from k137.boort
where bonr = 2
)
select count(*)
from har_2
where ddbid not in (
select ddbid from har_1
)
|
0 |
|
| Finns det personer som har BONR = 5 men saknar BONR = 4? |
with har_4 as (
select ddbid
from k137.boort
where bonr = 4
),
har_5 as (
select ddbid
from k137.boort
where bonr = 5
)
select count(*)
from har_5
where ddbid not in (
select ddbid from har_4
)
|
0 |
|
| Finns det personer som har BONR = 7 men saknar BONR = 6? |
with har_6 as (
select ddbid
from k137.boort
where bonr = 6
),
har_7 as (
select ddbid
from k137.boort
where bonr = 7
)
select count(*)
from har_7
where ddbid not in (
select ddbid from har_6
)
|
0 |
|
| Finns det personer som har BONR = 12 men saknar BONR = 11? |
with har_11 as (
select ddbid
from k137.boort
where bonr = 11
),
har_12 as (
select ddbid
from k137.boort
where bonr = 12
)
select count(*)
from har_12
where ddbid not in (
select ddbid from har_11
)
|
0 |
|
| Finns det personer som har BONR = 25 men saknar BONR = 24? |
with har_24 as (
select ddbid
from k137.boort
where bonr = 24
),
har_25 as (
select ddbid
from k137.boort
where bonr = 25
)
select count(*)
from har_25
where ddbid not in (
select ddbid from har_24
)
|
0 |
|