Jump to content

Exclude from MySQL SELECT


051119

Recommended Posts

Hi, I have the following query

select vb_user.username as "Username", vb_userfield.field14 as "Mileage" from vb_userfield 
join vb_user on vb_user.userid = vb_userfield.userid
order by vb_userfield.field14 desc[/Code]

and I want to ignore any results from the username [i]Paul[/i] / userid [i]1432[/i] (they are the same thing). Can anyone advise how to do this, I've tried adding [i]where !=[/i] but this doesn't seem to work?

 

Thanks

Link to comment
Share on other sites

Does this work?

SELECT vb_user.username AS "Username", vb_userfield.field14 AS "Mileage" 
FROM vb_userfield
INNER JOIN vb_user 
ON vb_user.userid = vb_userfield.userid
WHERE vb_user.username != 'Paul'
ORDER BY vb_userfield.field14 DESC

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.