take query sql [duplicated]

0

Hello, good morning and I look forward to your help. I need to get out of the table

restaurant:

, from the table user:

and the user_type table

all those restaurants that do not belong to a user type of id = 1 (owner) in this case is 3 (empty restaurant name), because as you can see in the user table the id_restaurante of each user is either 1 or 2 especially those related to user_type 1 (owner).

I have not consulted for a long time and I would like someone to help me

    
asked by T P 20.05.2017 в 22:15
source

1 answer

0

To get restaurants that do not belong to a user_type of id = 1 in SQL server, it would be something like:

SELECT a. * FROM restaurant to INNER JOIN user b ON a.id = b.id_restaurante WHERE b.id_type_user < > 1

Any questions or queries, we are to order, greetings.

    
answered by 21.05.2017 в 01:26