View Full Version : Possible?
dniwebdesign
12-23-2009, 06:16 AM
In order to make my life a little easier is this possible? If so, how do I do it and if not... what's the next best solution?
SELECT * FROM `table` WHERE `column1` != `column2`
oracleguy
12-23-2009, 06:26 AM
Have you tried it yet? I don't see why it shouldn't work.
dniwebdesign
12-24-2009, 12:08 AM
I tried it, says I have an error in my syntax...
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `payment_amount` != `invoice_total`' at line 1
Old Pedant
12-24-2009, 12:36 AM
Shouldn't matter, but try <> in place of != ???
I think it's more likely that there's actually another problem that the syntax checker just didn't notice until it got to this point.
Can you dump out the full SQL query for us to see??
dniwebdesign
12-24-2009, 10:45 PM
My bad...
It's my own fault for the syntax error. :\ I'll see if it works with the !=. Does the <> do the same thing?
Old Pedant
12-24-2009, 11:45 PM
!= and <> are supposed to be the same thing, and they are in MySQL 5.1, but I'm not sure about earlier versions.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.