On 05/25/2013 08:37 AM, Dan Lewis wrote:
On 05/25/2013 07:10 AM, Ian Whitfield wrote:
Thanks Noel !!!

On 25/05/13 11:58, Marion & Noel Lodge wrote:
Assuming your field is 'Country', try this -

    SELECT Country, Count(Country) AS 'Count'
    FROM <your Table name>
    GROUP BY Country
    ORDER BY Country
I had a problem, at first - as I always seem to do - with 'Syntax Error'!! So I created it with the Wizard and edited it in SQL view.

This resulted in ...

SELECT `Members`.`Country` AS `Country`
FROM `FedSaintsNew`.`Members` `Members`
GROUP BY `Members`.`Country`
ORDER BY `Members`.`Country`

This worked 100%!! So thanks very much. It does bring up two 'Blank' results, (which I guess must have a space in them or something). I don't know how to track these down but it's not too important.

Appreciate the help.

IanW
Pretoria RSA
If all you want is a count of the distinct countries in your table, try this:

SELECT COUNT( DISTINCT `Members`.`Country`) AS `Country`
FROM `FedSaintsNew`.`Members` `Members`

--Dan
     I forgot to mention one very important thing:
You must do this in SQL View. Then you must click the SQL icon. (This causes the SQL commands to be run directly. It will also prevent an error message because the Query Design dialog will not run this SQL otherwise.) After doing these things, run the query. You should get the number of distinct countries you have in your table.

--Dan

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to