psql -d postgres
\copy (SELECT vote_options.title, vote_options.vote_index, vote_options.user_votes_count, (DENSE_RANK() OVER(ORDER BY user_votes_count DESC ) ) as rank FROM "vote_options" WHERE "vote_options"."vote_id" = 1 ORDER BY "rank") to 'vote_rank.csv' with csv
|