0

i am trying to find unique videos in cql but dintinct cannot be used directly.so what approach we can use to find.i have created a separate table but still its not working

query = """ CREATE TABLE IF NOT EXISTS distinct_videos ( video_set SET, PRIMARY KEY (video_set) ); INSERT INTO distinct_videos (video_set) SELECT DISTINCT video FROM youtube_events; SELECT COUNT(*) FROM distinct_videos; """ try: result = session.execute(query) for row in result: print("Total unique videos:", row[0]) except Exception as e: print(e)

0 Answers0