sp.DataReceived += new SerialDataReceivedEventHandler
SELECT * FROM (
SELECT
articles.*,
CASE
WHEN type_id=3 THEN row_number() OVER (PARTITION BY type_id ORDER BY created)*2
ELSE row_number() OVER (PARTITION BY type_id ORDER BY created)+1
END ord
FROM articles
) result ORDER BY ord, type DESC
#1064 - У вас ошибка в запросе. Изучите документацию по используемой версии MySQL на предмет корректного синтаксиса около 'OVER (PARTITION BY type_id ORDER BY created)*2
ELSE row_number() OVER (PA' на строке 5