![]() In this tutorial, you have learned about the SQLite aggregate functions and how to apply them to calculate aggregates. The following statement uses the GROUP_CONCAT() function to return a comma-separated list of track name of the album id 10: SELECT GROUP_CONCAT( name) Similarly, the following statement finds the track whose length is shortest by using the MIN() function: SELECTĬode language: SQL (Structured Query Language) ( sql ) SQLite GROUP_CONCAT() function example In this example, the outer query returns the track whose length is equal to the longest time of all tracks returned by the subquery. In order to find the tracks whose length are the longest, you use the subquery: SELECT To find the longest time of all tracks, you use the MAX() function as follows: SELECT MAX(Milliseconds) / 60000 Minutes FROM The following example uses the SUM() function to calculate the length of each album in minutes: SELECTĬode language: SQL (Structured Query Language) ( sql ) SQLite MAX() function example Track_count DESC Code language: SQL (Structured Query Language) ( sql ) SQLite SUM() function example To find the albums and their corresponding track count, you use the following statement: SELECT The following statement returns the number of rows from the tracks table: SELECT COUNT(*)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |