051119 Posted January 9, 2010 Share Posted January 9, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/187876-exclude-from-mysql-select/ Share on other sites More sharing options...
Mchl Posted January 9, 2010 Share Posted January 9, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/187876-exclude-from-mysql-select/#findComment-991934 Share on other sites More sharing options...
051119 Posted January 9, 2010 Author Share Posted January 9, 2010 That's great, thanks very much! Quote Link to comment https://forums.phpfreaks.com/topic/187876-exclude-from-mysql-select/#findComment-992006 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.