Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8625619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:50:00+00:00 2026-06-12T07:50:00+00:00

I have this tables in my DB: USERS id email name last_access 1 user1@gmail.com

  • 0

I have this tables in my DB:

“USERS”

id  email                      name             last_access
1   user1@gmail.com     Name1 Surname1      2012-10-05 13:58:19.0
2   user2@gmail.com     Name2 Surname2      2012-10-05 13:56:59.0
3   user3@gmail.com     Name3 Surname3      2012-10-05 13:57:57.0

“NETS_PERMISSIONS”

user_id     network_id     perm
1           1234           3
2           1235           3

Now, I have this query:

SELECT DISTINCT user.id, user.name, nets.network_id, nets.perm
FROM users as user LEFT OUTER JOIN nets_permissions AS nets
ON user.id = nets.user_id AND nets.perm <> 3 WHERE user.id!=1 AND nets.network_id=1234

The result query is empty, but instead I want that
– from the ‘nets_permissions’ table, are left out rows with perm=3 and user_id and network_id like spiecified in the query (in this case for ex. user_id=1 and network_id=1234): in this case the left part of the query is empty.
– from the ‘users’ table I want take every row but, if it isn’t in the ‘nets_permissions’ table, the rows have network_id and perm .

So, from this two tables, in this example, I would this result:

id    name             network_id    perm
2     Irene Pippo      <null>        <null>
3     Luca Niccolini   <null>        <null>

Thank you very much to all of you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:50:01+00:00Added an answer on June 12, 2026 at 7:50 am

    This should give you what you want–only users who don’t have perm 3 and nework_id 1234

    SELECT u.id, u.name, n.network_id, n.perm
      FROM users as u 
      LEFT JOIN nets_permissions as n
        ON u.id = n.user_id AND n.perm = 3 AND n.network_id=1234 
     WHERE n.network_id IS NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have these tables: 'Users' id email name last_access 1 luca@gmail.com Luca Pluto 2012-10-05
I have three tables, table one (tableA) containing users data like name and email,
I have following relationships Users(id, name, email, ...) movies(id, name, ...) users_watchlists(id, user_id, movie_id)
I have 1 table with users in them like so: id name email status
Hello I have like this 2 tables class User public int UserId{get;set;} { ....
I have a 'users' SQL table structure like this (the ID is randomly generated
I have a 'users' SQL table structure like this (the ID is randomly generated,
I have two MySQL tables something like this: tool_owners: tool_owners_id | user_id | ...
I have a table which looks like this: mysql> SHOW COLUMNS FROM Users; +------------+--------------+------+-----+---------+----------------+
I have a couple of tables which look like this Table 1 user_id |

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.