I am using PostgreSQL, and I have a column in a table which contains very long text. I want to select this column in a query, but limit its display length.
Something lik
Slightly shorter:
SELECT left(longcolumn, 10) from mytable;
What you can do is use PostgreSQL's substring() method. Either one of the two commands below will work:
SELECT substring(longcolumn for 10) FROM mytable; SELECT substring(longcolumn from 1 for 10) FROM mytable;