Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New general search query with category division #8

Closed
falkirks opened this issue Mar 17, 2018 · 3 comments
Closed

New general search query with category division #8

falkirks opened this issue Mar 17, 2018 · 3 comments

Comments

@falkirks
Copy link
Member

No description provided.

@kevindhir
Copy link
Contributor

SELECT itemName 
FROM itemHas 
WHERE NOT EXISTS
((SELECT categoryName From itemHas)
EXCEPT
(SELECT queryCategory From query WHERE queryCategory = categoryName))

@falkirks falkirks reopened this Mar 23, 2018
@falkirks
Copy link
Member Author

@kevindhir I am not sure how to move forward with implementing that query. What params does it take? Does it require some table or view called query?

@falkirks
Copy link
Member Author

falkirks commented Mar 25, 2018

SELECT *
FROM food_items fi
WHERE NOT EXISTS
  (SELECT C.name FROM categories C WHERE (C.name = 'Fast food' OR C.name = 'Vegetarian') AND NOT EXISTS
    (SELECT ih.itemName
        FROM itemHas ih
        WHERE C.name = ih.categoryName
        AND ih.itemName=fi.name));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants