How many more devices are there of the brand vivo than of the brand LG?
how many more = SUBTRACT(SUM(IF(phone_brand = 'vivo',1,0)), SUM(IF(phone_brand = 'LG',1,0))); brand vivo refers to phone_brand = 'vivo'; brand LG refers to phone_brand = 'LG';
SELECT SUM(IIF(phone_brand = 'vivo', 1, 0)) - SUM(IIF(phone_brand = 'LG', 1, 0)) AS num FROM phone_brand_device_model2