Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
5 views
in SQL by (20.3k points)

I am using Sybase and I am doing a select which returns me a column called "iftype", but its type is int and I need to convert into varchar. When I try to do the select without the convert function I get this error:

Error code 257, SQL state 37000: Implicit conversion from datatype 'VARCHAR' to 'INT' is not allowed. Use the CONVERT function to run this query.

I dont know how to implement the function CONVERT. Can anyone help me, please ?

1 Answer

0 votes
by (40.7k points)

You can try using the convert function in this way:

SELECT CONVERT(varchar(10), fieldName) FROM Mytable

Related questions

0 votes
1 answer
0 votes
2 answers
0 votes
1 answer
asked Apr 26, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...