<?xml version="1.0" encoding="UTF-8"?>
<histoqueries>
 <histoquery>select count(*) from wordforms where lemma_id is null</histoquery>
 <histoquery>delete from wordforms where lemma_id is null</histoquery>
 <histoquery>select * from wordforms where oordeel_id is not null</histoquery>
 <histoquery>delete from wordforms where oordeel_id is not null</histoquery>
 <histoquery>SELECT W.wordform, count(*) 
FROM wordforms W 
GROUP BY W.wordform HAVING count(*) &gt; 1 limit 100</histoquery>
 <histoquery>SELECT W.wordform
FROM wordforms AS W
WHERE W.wordform IN (SELECT wordform FROM wordforms AS X WHERE X.lemma_id IS NOT NULL)
AND W.lemma_id IS NULL
</histoquery>
 <histoquery>select distinct W.wordform, W.lemma_id
from wordforms W, wordforms X
where W.wordform = X.wordform
and W.lemma_id &lt;&gt; X.lemma_id;
</histoquery>
 <histoquery>select distinct W.wordform, W.lemma_id
from wordforms W, wordforms X
where W.wordform = X.wordform
and W.lemma_id IS NULL
and X.lemma_id IS NOT NULL;
</histoquery>
 <histoquery>SELECT wordform, lemma_id
FROM wordforms W1
WHERE W1.wordform IN
(
select distinct W2.wordform
from wordforms W2
where W2.lemma_id IS NULL
);
</histoquery>
 <histoquery>SELECT wordform, lemma_id
FROM wordforms W1
WHERE W1.wordform IN
(
select distinct W2.wordform
from wordforms W2
where W2.lemma_id IS NULL
)
ORDER BY W1.wordform;
</histoquery>
</histoqueries>