OT : help needed with a mySQL request

Devin Asay devin_asay at byu.edu
Fri Nov 22 11:10:48 EST 2013


On Nov 22, 2013, at 8:47 AM, <jbv at souslelogo.com>
 wrote:

> Hi list,
> 
> I have a table with a Date column (among others).
> Each entry has a date that ranges from 1930 to 2013.
> For several entries, the content of other columns can be similar,
> only the Date value changes. For instance I can have
> aaa 2004
> aaa 2013
> I need to find with 1 single request all entries with Date = 2013
> that don't exist in the table with other Date values.
> I tried SELECT * FROM myTable WHERE MIN(Date) = 2013
> but that returns an error #1111 - Invalid use of group function
> 
> Any help would be much apreciated.
> Thanks in advance.
> jbv

I'm not exactly understanding what you're trying to do, but here are a couple of things to keep in mind:

- functions need to be embedded in the SELECT clause, not the WHERE clause.

- I have found that most MySQL interfaces require dates to be quotes; e.g., WHERE date = '2013'.

So a query like this should be legal (not tested):

SELECT foo, bar, MIN(date) FROM myTable WHERE date < '2012'

Again, I don't understand exactly what you want, but this might give you some clues.

Devin


Devin Asay
Learn to code with LiveCode University
http://university.livecode.com





More information about the use-livecode mailing list