This issue is fixed in Sybase IQ 12.7 ESD #2.
A query with a derived table that executed without error in Sybase IQ 12.5 returns an
item already exists
error in Sybase IQ 12.7 when
run against a Sybase IQ server or with a SQL Anywhere server using
a remote proxy table.
The error occurs in a query like the following where the derived table uses a column alias for a constant ('2' as import_item) and the outer query block has a column by the same name (import_item):
SELECT TB.dept_item, TB.import_item INTO #t_Test_table1 FROM ( SELECT '2' AS dept_item, '2' AS import_item FROM Test_Table A ) TB GROUP by TB.dept_item, TB.import_item
The workaround is to specify column aliases, for example:
SELECT TB.dept_item AS dept_item, TB.import_item AS import item