Re: ROWID bug in select statement with a GROUP BY clause
Posted in 1992
Topics: SQL Development & Query Writing
}
} Below is a SELECT statement which runs quite normally under version 4.0
} but gives an error when used under version 4.1. The environment is an
} NCR 3445 with SCO UNIX 3.2.2.
}
Interesting. I tried the select statement using 4.0 and 4.1. Each
failed with the same message:
294: The column (rowid) must be in the GROUP BY list.
} The problem is caused by the 'column' ROWID in combination with 'GROUP BY',
} the error issued is -294: The column 'column-name' must be in the GROUP BY
} list.
}
} Is there a bug fix for this ROWID - GROUP BY problem and if there is, is
} there an anonymous ftp site that we can get the fix?
}
} SELECT a.ROWID,
} a.field1,
} SUM (b.field2)
} FROM table1 a,
} table2 b
} WHERE b.id = a.id
} GROUP BY field1
}
Perusing the manuals indicates that only aggregate functions can be included
in the select list without including them in the group by list. It would
appear that what you term a 'bug' is actually the proper behavior. No
explanation for why it worked under your version of 4.0. It apparently
shouldn't have.
--
Rory Martin Internet: dksl2vq@bell-atl.com
Bell Atlantic Network Services
2221-L Broadbirch Drive Voice: 1+ (301) 989-5075
Silver Spring, MD 20904-1985 "No matter where you go, there you are."
---------------------------------------------------------------------------