I have a table like this:
CREATE TABLE tab1 (
id INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
cod TEXT,
type TEXT,
qta INTEGER);
INSERT INTO tab1 (cod, type, qta)
VALUES ('aaa','aaa,bbb,ccc', 3),
('aaa','ddd', 1),
('aaa','eee,fff', 4),
('aaa','ggg,hhh', 2),
('aaa','out', 7),
('aaa','out', 7);
I would like to know how many words there are in each cell of column 'type'.
The best for me is to have only the rows that the number of words are the same of 'qta'.
So I would like to have only the rows with id 1, 2, 4
Original link to code: here