sql - MySQL Filter results -


I have a SQL table that has been called actions:

  + - - - + -------- + ------ + --------- + | ID | Action | Type | User_id | + ---- + -------- + ------ + --------- + | 1 | 5 | 4 | 1 | | 2 | 6 | 4 | 1 | | 3 | 5 | 4 | 2 | | 4 | 0 | 0 | 2 | | 5 | 0 | 1 | 2 | + ---- + -------- + ------ + --------- +  

And I like the user table Therefore:

  + ---- + ------------ + ------------------ - --------------- + ---------- + | ID | Full name Password | Username + ---- + ------------ + ------------------------------- --- + ---------- + | 1 | Admin user | Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | Administrator | | 2 | Arthur | Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | Arthur | | 3 | John | Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | John | + ---- + ------------ + ------------------------------- --- + ---------- +  

I want to select all the tasks from the action table except the operation of the Administrator, I have tried to:

  Select from * works where user_id! = 1;  

But this does not work in some instances because admin user_id is not always 1.

How do I go about choosing all the tasks except the Admin task, I

Cheers

IEF

  actions from internals on users.id at actions.user_id = users.id where the user join User name = "admin";  

All controllers believe that the username "administrator"


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -