MAX(dc.categoryID) needs to be
aliased
so
MAX(dc.categoryID), AS
CategoryID
otherwise the column will come back as a temp named
column
-Original Message-From: cfaussie@googlegroups.com
[mailto:[EMAIL PROTECTED]On Behalf Of Seona
BellamySent: Monday, May 08, 2006 3:57
I think categoryid needs to be in the group by clause if you are going
to use max() on it.
Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
www.flashdev.org.au
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
On 08/05/06, Lucas <[EMAIL PROTECTED]> wrote:
yeah, as you are using a MAX() you are going to need a group by...try...group by d.docTitle, d.docIntro, d.docContent, d.docImage,
d.ID
Hmm I changed the query to this:
SELECT
DISTINCT(d.docTitle), d.docIntro, d.docContent, d.docImage,
yeah, as you are using a MAX() you are going to need a group by...try...group by d.docTitle, d.docIntro, d.docContent, d.docImage,
d.IDOn 5/8/06, Seona Bellamy <[EMAIL PROTECTED]> wrote:
On 08/05/06, Lucas <[EMAIL PROTECTED]
> wrote:
Ok, that is what is playing up for you -
ask you can have more t
On 08/05/06, Lucas <[EMAIL PROTECTED]> wrote:
Ok, that is what is playing up for you -
ask you can have more than one category per article, dc.categoryID will
make two records that appear the same to be different (two different
categoryIDs)you may want to wrap it in a Max() so you only get one cate
Ok, that is what is playing up for you - ask you can have more than one category per article, dc.categoryID will make two records that appear the same to be different (two different categoryIDs)you may want to wrap it in a Max() so you only get one categoryID.
L.On 5/8/06, Seona Bellamy <[EMAIL PRO
I think Chris has probably hit on the problem with the mutliple categories. If you are selecting the category as one of the fields, then your query will return a separate record for each category. The records aren't affected by DISTINCT when the records aren't actually the same.
BlairOn 5/8/06, Seo
On 08/05/06, Chris Velevitch <[EMAIL PROTECTED]> wrote:
I think might have to use the distinct in a subqueryselect ... where d.id = (SELECT DISTINCT(d.ID) from r_document AS d, r_docByType
AS dt WHERE dt.docTypeID= 1 AND dt.documentI
On 08/05/06, Chris Velevitch <[EMAIL PROTECTED]> wrote:
Can a document have more than one category or type?
A document will only ever have 1 type, but it can have more than 1 category.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to t
I think might have to use the distinct in a subquery
select ... where d.id = (SELECT DISTINCT(d.ID) from r_document AS d,
r_docByType AS dt WHERE dt.docTypeID
= 1 AND
dt.documentID = d.ID ... LIMIT 3)
and then use the that to ge
Can a document have more than one category or type?
Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
www.flashdev.org.au
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To
11 matches
Mail list logo