How to do SELECT SUBSTR(COLUMN1, 1, 3), * FROM TABLE1 in DB2
In T-SQL you can do following
SELECT SUBSTRING(COLUMN1, 1, 3), * FROM TABLE1
But in DB2 I get the following error
ERROR [42601] [IBM][DB2] SQL0104N An unexpected token "," was found following "". Expected tokens may include: "FROM INTO". SQLSTATE=42601
Is it possible to do t开发者_如何学JAVAhis in DB2?
SELECT SUBSTRING(COLUMN1, 1, 3), * FROM TABLE1
NOTE
I am using asp.net to execute the query above
EDITI want to be able to grab everything but do a substring or a small calculation on one of the columns. I want to do a substring on one of the columns but I don't want to list out every column.
As already stated by maple_shaft your question doesn't really make sense, but the following should work (cannot try it right now though)
SELECT Column1, table1.*
FROM TABLE1
Without the ing
SELECT SUBSTR(COLUMN1, 1, 3), * FROM TABLE1
To select all the columns:
SELECT Table1.* FROM Table1
精彩评论