sql - SQLiteman help needed -
hi need uni assignment, need answer 2 questions: 1) list titles of videos available in more 1 format number of different formats available each title.
my query was:
select title video video_id in ( select video_id, count(format_id) avaliableformats video_format group title having count(format_id) > 1);
but result says "query error: single result allowed select part of expression"- i'm not sure means or need fix it?
q 2 5) list titles of videos have average cost (across formats) more $2.
my query
select title video video_id in ( select video_id video_format group title having avg(cost) > 2);
but brings 1 result (row there should 2).
if can please really appreciate it!
the first is:
select title video video_id in ( select video_id video_format group title having count(format_id) > 1)
if using in
1 column can inside inner query otherwise use exist
the 2nd:
select title video video_id in ( select video_id video_format group video_in having avg(cost) > 2)
if understood correctly , video in relates title 1 one, made bit mess group by
.
Comments
Post a Comment