[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Steve Onnis
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

[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Chris Velevitch
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

[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Seona Bellamy
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,

[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Lucas
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

[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Seona Bellamy
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

[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Lucas
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

[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Blair McKenzie
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

[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Seona Bellamy
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

[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Seona Bellamy
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

[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Chris Velevitch
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

[cfaussie] Re: DISTINCT not so distinct

2006-05-07 Thread Chris Velevitch
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