Re: [SQL] Aggregates not allowed in WHERE clause?

2002-06-19 Thread Achilleus Mantzios
On 19 Jun 2002, Joachim Trinkwitz wrote: > Hi all, > > I have a table (lv) with a field "semester" and I'm trying to fish out all > rows which have a value corresponding to a max() value of another > table's (lf_sem) "semester" field. The intention is to keep a value > with the current term in l

Re: [SQL] Aggregates not allowed in WHERE clause?

2002-06-19 Thread Christopher Kings-Lynne
> Next I tried this one: > > SELECT kvvnr, max(lf_sem.semester) AS akt_semester > FROM lv, lf_sem > WHERE lv.semester = akt_semester; > > Now I got: 'Attribute 'akt_semester' not found' > > Is there another way to get what I want? What about: SELECT kvvnr FROM lv WHERE semester = (SELEC

[SQL] Aggregates not allowed in WHERE clause?

2002-06-19 Thread Joachim Trinkwitz
Hi all, I have a table (lv) with a field "semester" and I'm trying to fish out all rows which have a value corresponding to a max() value of another table's (lf_sem) "semester" field. The intention is to keep a value with the current term in lf_sem so I can get all rows which concern this term.

Re: [SQL] text vs varchar

2002-06-19 Thread Achilleus Mantzios
On Tue, 18 Jun 2002, Josh Berkus wrote: > Wei, > > > Is there any disadvantage of using TEXT datatype as opposed to a VARCHAR > > datatype with a maximum length, especially when I do searches on them? > > Yes. You can't index TEXT because it's of potentially unlimited length. Well indexing te

[SQL] Help with a "recursive" query

2002-06-19 Thread Jerome Alet
Hi, I've got a table like this : idparent description 0100 xx 0200 xx 0301 xx 0402 xx 0501 xx 0605 xx 0703 xx 0807