Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT items.Id, items.Name, DishInItem = CASE WHEN dishes.id IS NOT NULL THEN 1 ELSE 0 END
- FROM Items items
- LEFT JOIN(
- Dishes_Items ditems
- INNER JOIN Dishes dishes
- ON ditems.dishId = dishes.Id AND dishes.id = @dishId )
- ON items.Id = ditems.itemId
- WHERE dishes.id IS NOT NULL
- OR items.name LIKE '%%'
Add Comment
Please, Sign In to add comment