Jump to content

This topic is 3486 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

I thought I should post this.  It seems GROUP BY  in FMPs ExecuteSQL function requires all the SELECT fields to work properly where that is not the case with mySql. 

 

SELECT
province, city, COUNT(*)
FROM
data
WHERE
province in ( 'ON', 'BC')
GROUP BY
province, city

 

RESULT:

BC, Abbotsford, 3
BC, Burnaby, 2
BC, Castlegar, 1
BC, Chilliwack, 3

 

 

ca-500.zip

Edited by rivet
  • Like 1
  • 4 weeks later...
Posted

Yes, this is true. So a SELECT *, COUNT(*) would require you to list ALL fields that might be returned in the GROUP BY (ugh!) And another reason I don't like to use "*" in the aggregates or in the SELECT at all. :)

This topic is 3486 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.