All we need is an easy explanation of the problem, so here it is.
I have a three column table
CREATE TABLE "colls" ( "w1" TEXT, "w2" TEXT, "coocc_freq" INTEGER )
I just want to get w1 and w2 with s value:
SELECT * FROM colls where w1='s' or w2='s' order by coocc_freq desc
How I can to keep just two columns? w1 + w2 –
s = w
I.e I want to skip
s value and get something like:
How to solve :
I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.
SELECT COALESCE(NULLIF(w1, 's'), w2) AS w coocc_freq FROM colls WHERE 's' IN (w1, w2);
Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂