OT : help needed with a mySQL request

jbv at souslelogo.com jbv at souslelogo.com
Fri Nov 22 11:19:57 EST 2013


Hi Devin,

Thanks for your reply. I'll try to make myself a bit more clear...
Let's say I have the following table (2 columns, 4 entries) :
  aaa 2004
  aaa 2013
  bbb 2013
  ccc 2013

I need to output with 1 single request entries bbb and ccc
because they're the only ones that don't exist in the table
with a date value other than 2013.
Of course, I don't need to do that with 2013 only but with
a wide range of dates from 1980 to 2013, but everytime
the approach is the same with a specific year.
Does it make more sense now ?

Thanks.
jbv

>
> 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
>






More information about the use-livecode mailing list