Monday, 27 April 2015

INTERVAL ( ) and STRCMP ( ) Functions in mysql

INTERVAL() and STRCMP() Functions

The INTERVAL( ) function compares the first integer listed as an argument to the integers that follow the first integer

SELECT STRCMP(‘big’, ‘bigger’);

STRCMP( ) function compares exactly two values.
 The function returns a 0 if <expression1> equals <expression2> ,
 returns -1 if <expression1> is smaller than <expression2>. 
and returns 1 If <expression1> is larger than <expression2>

SELECT OrderID, TransID, DVDID
FROM Transactions
WHERE DVDID=LEAST(@dvd1, @dvd2)
ORDER BY OrderID, TransID;

No comments:

Post a Comment