![]() Carlos Soublette #8-35Ĭarrera 52 con Ave. MySQL Examples MySQL Examples MySQL Editor MySQL Quiz MySQL Exercises MySQL CertificateĬarrera 22 con Ave. ![]() Write a query to sort the records in the descending order of the agent salary stored in the agents table.String Functions ASCII CHAR_LENGTH CHARACTER_LENGTH CONCAT CONCAT_WS FIELD FIND_IN_SET FORMAT INSERT INSTR LCASE LEFT LENGTH LOCATE LOWER LPAD LTRIM MID POSITION REPEAT REPLACE REVERSE RIGHT RPAD RTRIM SPACE STRCMP SUBSTR SUBSTRING SUBSTRING_INDEX TRIM UCASE UPPER Numeric Functions ABS ACOS ASIN ATAN ATAN2 AVG CEIL CEILING COS COT COUNT DEGREES DIV EXP FLOOR GREATEST LEAST LN LOG LOG10 LOG2 MAX MIN MOD PI POW POWER RADIANS RAND ROUND SIGN SIN SQRT SUM TAN TRUNCATE Date Functions ADDDATE ADDTIME CURDATE CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP CURTIME DATE DATEDIFF DATE_ADD DATE_FORMAT DATE_SUB DAY DAYNAME DAYOFMONTH DAYOFWEEK DAYOFYEAR EXTRACT FROM_DAYS HOUR LAST_DAY LOCALTIME LOCALTIMESTAMP MAKEDATE MAKETIME MICROSECOND MINUTE MONTH MONTHNAME NOW PERIOD_ADD PERIOD_DIFF QUARTER SECOND SEC_TO_TIME STR_TO_DATE SUBDATE SUBTIME SYSDATE TIME TIME_FORMAT TIME_TO_SEC TIMEDIFF TIMESTAMP TO_DAYS WEEK WEEKDAY WEEKOFYEAR YEAR YEARWEEK Advanced Functions BIN BINARY CASE CAST COALESCE CONNECTION_ID CONV CONVERT CURRENT_USER DATABASE IF IFNULL ISNULL LAST_INSERT_ID NULLIF SESSION_USER SYSTEM_USER USER VERSION Hence, the records, by default, will be sorted in ascending order.Īll the records present in the agents table are displayed in the ascending order of the customer's salary. No keyword is used after the ORDER BY clause. Here in a SELECT query, an ORDER BY clause is applied on the column 'Salary' to sort the records. Mysql> SELECT *FROM agents ORDER BY Salary Write a query to sort the records in the ascending order of the agent names stored in the agents table. Consider we have another table named agents with the following records: AID DESC keyword will sort the records in descending order.Īll the records present in the customers table are displayed in the descending order of the customer's age. Here in a SELECT query, an ORDER BY clause is applied on the column 'Age' to sort the records. Mysql> SELECT *FROM customers ORDER BY Age DESC Syntax to sort the records in ascending order:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |