Set the field return size

Asked

Viewed 258 times

2

I have an sql:

Select a.nome

From tabela a

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

Edit: It’s for IBM’s Informix

1 answer

2


You can use the function SUBSTRING.

SELECT substring(a.nome from 1 for 50) FROM Tabela a
  • Does not work for Informix

  • 2

    I did, but it’s another syntax, it changes the answer and I accept it: SELECT substring(a.nome from 1 for 50) FROM Tabela a

  • 1

    So close. I didn’t even see the Tag Informix. Mals...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.