The Select field in sybase15 does not strictly match the field in group. That is to say, if the SELECT statement contains more fields than the group by statement, it is no problem.
The following is an example:
(1) create a table and initialize data
Create Table t_sxf_test (
Year varchar (6 ),
City_code numeric (4 ),
Id numeric (4 ),
Name varchar (32)
)
Insert into t_sxf_test
Values ('20140901', 2008, 'kq ')
Insert into t_sxf_test
Values ('20140901', 2008, 'sxf ')
Insert into t_sxf_test
Values ('20140901', 2008, 'ly ')
Insert into t_sxf_test
Values ('20140901', 2009, 'macx ')
(2) Test the query statement with group
Select Year, city_code, ID, max (name)
From t_sxf_test
Group by year, city_code
Result:
Year, city_code, ID,
'20140901', 2009, 'sxf'
'20140901', 2009, 'sxf'
'20140901', 2009, 'sxf'
'1111', 2008, 'Q'
(3) Conclusion
If the select field is more than the group by field, all records meeting the conditions are displayed. No error is reported or merged. Group by is still valid for statistical functions.