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

[email protected] (Richard Quadling)
Newsgroups php.db
Message-ID <[email protected]>
On 13 August 2010 13:43, Ron Piggott <[email protected]> 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_reference` ON
> `bible_concordance_words`.`reference` =
> `bible_concordance_word_reference`.`bible_concordance_words_reference`
> WHERE `word` LIKE '$letter%' ORDER BY `word` ASC

SELECT
	`bible_concordance_words`.`word`,
	COUNT(`bible_concordance_word_reference`.`bible_concordance_words_reference`)
AS occurrences
FROM
	`bible_concordance_words`
	INNER JOIN
	`bible_concordance_word_reference` ON
		`bible_concordance_words`.`reference` =
`bible_concordance_word_reference`.`bible_concordance_words_reference`
WHERE
	`word` LIKE '$letter%'
GROUP BY
	`bible_concordance_words`.`word`,
ORDER BY
	`word` ASC

-- 
Richard Quadling.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.