informix

Show a one to many relationship as 2 columns - 1 unique row (ID & comma separated list)

风流意气都作罢 提交于 2019-11-26 15:28:10
I need something similar to these 2 SO questions, but using Informix SQL syntax. Concatenate several fields into one with SQL SQL Help: Select statement Concatenate a One to Many relationship My data coming in looks like this: id codes 63592 PELL 58640 SUBL 58640 USBL 73571 PELL 73571 USBL 73571 SUBL I want to see it come back like this: id codes 63592 PELL 58640 SUBL, USBL 73571 PELL, USBL, SUBL See also group_concat() in Informix . I believe that the answer you need is a user-defined aggregate, similar to this one: CREATE FUNCTION gc_init(dummy VARCHAR(255)) RETURNING LVARCHAR; RETURN '';

Which join syntax is better?

ぃ、小莉子 提交于 2019-11-26 10:02:26
问题 So we are migrating from Informix to Sql Server. And I have noticed that in Informix the queries are written in this manner: select [col1],[col2],[col3],[col4],[col5] from tableA, tableB where tableA.[col1] = table.[gustavs_custom_chrome_id] Whereas all the queries I write in SQL Server are written as: select [col1],[col2],[col3],[col4],[col5] from tableA inner join tableB on tableA.[col1] = table.[gustavs_custom_chrome_id] Now, my first thought was: that first query is bad. It probably

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints

半城伤御伤魂 提交于 2019-11-26 00:23:49
问题 I make an outer join and executed successfully in the informix database but I get the following exception in my code: DataTable dt = TeachingLoadDAL.GetCoursesWithEvalState(i, bat); Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. I know the problem, but I don\'t know how to fix it. The second table I make the outer join on contains a composite primary key which are null in the previous outer join query. EDIT: SELECT UNIQUE