Re: [SQL] Novice SQL Question

2004-02-02 Thread Tom Lane
Terry Lee Tucker <[EMAIL PROTECTED]> writes: > If I put this where I thought it should go as in: > select distinct event_code,level from logs join stat on (stat.prime is not > null) where order_num = 130680 order by event_date,event_time,event_secs; > I get the following error: > ERROR: For SELE

Re: [SQL] Novice SQL Question

2004-02-02 Thread Terry Lee Tucker
To answer my own question: I discoverd that the order by fields had to be in the select list. Apparently, this is a requirement when using "DISTINCT". On Monday 02 February 2004 05:38 pm, Terry Lee Tucker wrote: > I need to the following query: > select distinct event_code, level from logs join

[SQL] Novice SQL Question

2004-02-02 Thread Terry Lee Tucker
I need to the following query: select distinct event_code, level from logs join stat on (stat.prime is not null) where order_num = 130680; Ok, no problem. Does exactly what I want; however, I need to sort this is a particular way to get the right results. When I try to add the order by clause,