sqlite - Mismatch of columns in UNION ALL statement -
i have query,
(select [name], [name] result, ' - ' value, 0 ordering [party_mstr] union (select [party_mstr].[name], ' - ' || [t1].[t_name], (select [t2].[t_name], sum(coalesce([t2].[value1], 0)) + [t2] cross join [t1] on [t1].[t_name] = [t2].[t_name] group [t2].[t_name]), 1 [party_mstr] cross join [t1] ) x;
when run query, got error selects left , right of union not have same number of result columns
now remove comments, , second error comes, only single result allowed select part of expression
. what's wrong queries.? using sqlite database.
with comment there 4 fields on left of union , 5 on right.
the subselect on right of union returns more 1 row. that's why second error.
... , please edit code there sql there.
Comments
Post a Comment