How to write nested queries in select clause
问题 I'm trying to produce this SQL with SLICK 1.0.0: select cat.categoryId, cat.title, ( select count(product.productId) from products product right join products_categories productCategory on productCategory.productId = product.productId right join categories c on c.categoryId = productCategory.categoryId where c.leftValue >= cat.leftValue and c.rightValue <= cat.rightValue ) as productCount from categories cat where cat.parentCategoryId = 2; My most successful attempt is (I dropped the "joins"