MySQL strcmp() Function Example

MySQL strcmp() Function Example :: on Equals,Larger,Smaller,NULL Values

Open your MySQL Query Editor then copy & paste the bellow code to get the value of strcmp() MySQL Function Example:

   -- mysql strcmp() function compares exactly two values.

   -- The mysql strcmp() function returns 0 if  equals 
   select strcmp('test', 'test') ;

   -- mysql strcmp() function returns -1 if  is smaller than 
   select strcmp(2*2, 3*3) , 2*2, 3*3 ;

   -- The mysql strcmp() function returns 1 if  larger than 
   -- OR if the comparison returns a NULL
   select strcmp(99, 90), strcmp('noor.hasan','cfsuman');

   -- mysql strcmp() function returns NULL if  or  is NULL
   select strcmp(NULL, NULL), strcmp(10, NULL), strcmp(NULL, 0/0);

-- is comment in MySQL -- in fact it is comment in MSSQL and Oracle as well

MySQL strcmp() Function Example - Result in MySQL Query Editor


Related Tutorial Examples

  1. MySQL isnull() Function Example
  2. MySQL strcmp() Function Number Value Example
  3. MySQL strcmp() Function NULL Value Example
  4. MySQL interval() Function Example
  5. MySQL coalesce() Function Example
  6. MySQL IF() Function Boolean Value Example
  7. How To Find MySQL SERVER VERSION Information
  8. MySQL Stored Procedure: INSERT INTO SELECT... Example
  9. MySQL Sub-Query: CREATE TABLE SELECT... Example
  10. MySQL Sub-Query: CREATE TABLE SELECT *... Example

No comments:

Post a Comment

leave your comments here..