[Sqlalchemy-tickets] [sqlalchemy] #578: SELECT with group by UNION select drops the group by clause
Brought to you by:
zzzeek
From: sqlalchemy <mi...@zz...> - 2007-05-18 16:29:55
|
IzU3ODogU0VMRUNUIHdpdGggZ3JvdXAgYnkgVU5JT04gc2VsZWN0IGRyb3BzIHRoZSBncm91cCBi eSBjbGF1c2UNCi0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCiBSZXBvcnRlcjogIGd1ZXN0ICAgfCAgICAg ICAgICBPd25lcjogIHp6emVlayAgICAgICAgICAgICAgICANCiAgICAgVHlwZTogIGRlZmVjdCAg fCAgICAgICAgIFN0YXR1czogIG5ldyAgICAgICAgICAgICAgICAgICANCiBQcmlvcml0eTogIG1l ZGl1bSAgfCAgICAgIE1pbGVzdG9uZTogICAgICAgICAgICAgICAgICAgICAgICANCkNvbXBvbmVu dDogIHNxbCAgICAgfCAgICAgICBTZXZlcml0eTogIG5vIHRyaWFnZSBzZWxlY3RlZCB5ZXQNCiBL ZXl3b3JkczogICAgICAgICAgfCAgIFN0YXR1c19maWVsZDogIGF3YWl0aW5nIHRyaWFnZSAgICAg ICANCi0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCiBXZSBoYXZlIGEgdGFibGUgd2l0aCB0d28sIGRpc2pv aW50LCBzdWJ0eXBlczogc2luZ2xlLXJvdyBlbnRpdGllcywgYW5kDQogZW50aXRpZXMgd2hpY2gg bXVzdCBiZSBzdW1tZWQgYW5kIGdyb3VwZWQuICBDbGVhcmx5LCB0aGVzZSBjb3VsZCBoYXZlIGJl ZW4NCiBwdXQgaW4gZGlmZmVyZW50IHRhYmxlcywgc2luY2UgdGhleSByZXByZXNlbnQgZGlmZmVy ZW50IGdyYW51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