Whats the meaning of SELECT 1 SQL statement?
I have come across this sql
select * from category where exists ( select (1) from products where category.id = products.id )
Select 1 is used when you want to check the existence of a row in a table and not bothered about its contents.
In your SQL statement you are selecting all categories that has atleast one product.