Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Databases General > Strange problem...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 3182 of 3295
Post > Topic >>

Strange problem with MySQL string comparison

by jammypodger <rick@[EMAIL PROTECTED] > Jun 5, 2008 at 04:48 AM

I have been using MySQL on and off for a number of years but I am
stumped by this problem.

I am doing a select which requires a join to a second table using an
account key, I have a WHERE clause which ensures that I only get the
correct type of account.
Basically the type of account is 'CUSTOMER' but if I use the code

....
WHERE ACCOUNT.TYPE="CUSTOMER"
....

Then I get no matches.
However, if I use

....
WHERE STRCMP(ACCOUNT.TYPE,"CUSTOMER")=0
....

Then I get matches as expected.

Could anyone explain why I get a result set with a STRCMP match, but
not with the equals operator?

TIA
 




 9 Posts in Topic:
Strange problem with MySQL string comparison
jammypodger <rick@[EMA  2008-06-05 04:48:02 
Re: Strange problem with MySQL string comparison
jammypodger <rick@[EMA  2008-06-05 04:58:21 
Re: Strange problem with MySQL string comparison
"David Cressey"  2008-06-05 12:10:35 
Re: Strange problem with MySQL string comparison
jammypodger <rick@[EMA  2008-06-05 05:35:33 
Re: Strange problem with MySQL string comparison
John Gordon <gordon@[E  2008-06-05 17:51:59 
Re: Strange problem with MySQL string comparison
jammypodger <rick@[EMA  2008-06-05 11:12:28 
Re: Strange problem with MySQL string comparison
--CELKO-- <jcelko212@[  2008-06-06 13:13:07 
Re: Strange problem with MySQL string comparison
Tonkuma <tonkuma@[EMAI  2008-06-07 08:33:31 
Re: Strange problem with MySQL string comparison
jammypodger <rick@[EMA  2008-06-07 13:40:45 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 9:46:05 CST 2008.