Define the size of the field return

2

I have a sql:

Select a.nome

From tabela a

I want to return the name, but suppose my name field has Varchar size (100), but I want to return the first 50 characters.

Edit: Is for IBM Informix

    
asked by anonymous 28.05.2015 / 16:44

1 answer

2

You can use the SUBSTRING function.

SELECT substring(a.nome from 1 for 50) FROM Tabela a
    
28.05.2015 / 16:47