(Postgre)SQL

Ʌ: Tech

JSON

Selecting JSON as VARCHAR

SELECT CAST(my_json_col AS VARCHAR) FROM my_table
SELECT my_json_cal::varchar FROM my_table

Select most common value from a column

SELECT `column`, COUNT(`column`) AS `value_occurrence` 
    FROM     `my_table`
    GROUP BY `column`
    ORDER BY `value_occurrence` DESC
    LIMIT    1;