Re: [PHP-DB] COUNT() query help

2010-08-13 Thread Richard Quadling
On 13 August 2010 13:43, Ron Piggott wrote: > SELECT `bible_concordance_words`.`reference`, > `bible_concordance_words`.`word`, > COUNT(`bible_concordance_word_reference`.`bible_concordance_words_reference`) > AS occurrences FROM `bible_concordance_words` INNER JOIN > `bible_concordance_word_refer

[PHP-DB] COUNT() query help

2010-08-13 Thread Ron Piggott
I am making a Bible concordance. I need help with the query that figures out how many times each word is in the Bible. The COUNT() in the query below is giving me the total number of words for the letter of the alphabet, not the specific word, and is causing there to be only 1 search result. I h

Re: [PHP-DB] count query

2002-01-08 Thread Daniel Barton
Hi, SELECT SUM(IF(id = '2',1,0)) AS field_name FROM table Versatile command - you can use it for quite a lot of things. Barry Rumsey wrote: > Is it posible to do a count(*) on a tabe where id=2 and count just those that id = >2 -- -- Dan Barton Terrestrial Program Biologist Asst. D

Re: [PHP-DB] count query

2002-01-08 Thread DL Neil
Barry, Is it posible to do a count(*) on a tabe where id=2 and count just those that id = 2 =why don't you try it? The answer is yes, because count(*) means count the entire number of non-null rows selected. See manual: 3.3.4.8 Counting Rows =dn -- PHP Database Mailing List (http://www

[PHP-DB] count query

2002-01-08 Thread Barry Rumsey
Is it posible to do a count(*) on a tabe where id=2 and count just those that id = 2