[Corpora-List] Help on SQL SELECT and UPDATE statements ? (fwd)

Listserv Administrator listman at listserv.linguistlist.org
Sat Aug 4 18:06:05 UTC 2007


---------- Forwarded message ----------
Date: Thu, 12 Jul 2007 14:49:43 -0600
From: Mark Davies <Mark_Davies at byu.edu>
To: Mark Greenwood <mark at dcs.shef.ac.uk>, corpora at uib.no
Subject: Re: [Corpora-List] Help on SQL SELECT and UPDATE statements ?

>> select max(freq) as freq, word1, word2, partOfSpeechWord2 from
TagTable
group by word1, word2;

Unfortunately, it doesn't work (at least on SQL Server, but I suspect on
most RDBMS's). It produces the error:

Column 'partOfSpeechWord2 ' is invalid in the select list because it is
not contained in either an aggregate function or the GROUP BY clause.

If you add [partOfSpeechWord2] to the GROUP clause, then it just tells
you how many times that POS tag occurs, but not which POS is the most
frequent one for [word2].

Mark Davies

============================================
Mark Davies
Professor of (Corpus) Linguistics
Brigham Young University
(phone) 801-422-9168 / (fax) 801-422-0906
Web: davies-linguistics.byu.edu

** Corpus design and use // Linguistic databases **
** Historical linguistics // Language variation **
** English, Spanish, and Portuguese **
============================================


_______________________________________________
corpora mailing list
corpora at uib.no
http://mailman.uib.no/listinfo/corpora



More information about the Corpora mailing list