INTERVAL() and STRCMP() Functions
The INTERVAL( ) function compares the first integer listed as an argument to the integers that follow the first integerSELECT 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;
SELECT OrderID, TransID, DVDID
FROM Transactions
WHERE DVDID=LEAST(@dvd1, @dvd2)
ORDER BY OrderID, TransID;
No comments:
Post a Comment