I have to do an UPDATE table that includes a SELECT COUNT but that takes way too long.
That was my original query
UPDATE list SET count =
(SELECT COUNT(*) FROM set_1 WHERE set_1.start BETWEEN list.start AND list.end);
I just have 100 rows to update so I was thinking of just do a select count and display it on screen. And then I’ll copy/paste the result on my excel spreadsheet.
I was intended to do this, but it returns only one number (and not 100 rows of number)
SELECT COUNT(*) FROM set_1,list WHERE set_1.start BETWEEN list.start AND list.end;
But that doesn’t work it returns one big number of all the SELECT COUNT together ..
Anyone can help me out with this ?
You are doing a cartesian product between set1 and list