For all the videos, represent the number of views in multiples of thousands.
For example, if the number of views of a video is 17,200, it is represented as 17.2 in the output.
Table: video
video_id name no_of_views_in_thousands
... ... ...
just tell me the form of converting the views of videos for EX 17,200 into 17.2.
and the code i had written for this is:-
SELECT
video_id,
name,
(no_of_views) AS no_of_views_in_thousands
FROM
video
WHERE
cast(strftime("%d", no_of_views) AS float)
ORDER BY
no_of_views_in_thousands DESC,
name ASC;
The required query with the expected result are given below-
SELECT * FROM mydb.channel_traffic where no_of_views>4000 ORDER BY no_of_views,name desc;
Comments
Leave a comment