Guest User

Untitled

a guest
Jul 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. SELECT items.Id, items.Name, DishInItem = CASE WHEN dishes.id IS NOT NULL THEN 1 ELSE 0 END
  2. FROM Items items
  3. LEFT JOIN(
  4. Dishes_Items ditems
  5. INNER JOIN Dishes dishes
  6. ON ditems.dishId = dishes.Id AND dishes.id = @dishId )
  7. ON items.Id = ditems.itemId
  8. WHERE dishes.id IS NOT NULL
  9. OR items.name LIKE '%%'
Add Comment
Please, Sign In to add comment