I am actually using ABS database
and handles SQL statements
I have this now
select romname,(SELECT location from roms j1 where j2.romname=j1.romname
order by location limit 1) as location
FROM roms j2 where location in('1','7') group by romnumber
but getting the error
[6/29/2009 5:45:48 PM] Executing Query:
select romname,(SELECT location from roms j1 where j2.romname=j1.romname
order by location limit 1) as location
FROM roms j2 where location in('1','7') group by romnumber
[6/29/2009 5:45:48 PM] Token 'FROM' expected, but '1' found at line 1,
column 98 - Native error: 30184
Roms is my table name and Romname is a String and Location is a string
_____
From: [email protected] [mailto:[email protected]] On Behalf
Of Kevin McCoy
Sent: Monday, June 29, 2009 5:27 PM
To: [email protected]
Subject: [delphi-en] Re: Is this possible? if so how
This probably isn't optimal, but here is a SQL query that works in MySQL and
does what you want.
------------------------
SELECT name,
(select state from junk j1 where j2.name=j1.name order by state limit 1) as
state
FROM junk j2
where state in ('CA', 'FL')
group by name
------------------------
Junk is a 3 column table:
ID : integer - unique id
Name:string
state:string
I added the ID column just to make it easy to edit for me.
I am not an Access programmer, so I have no idea if you can do such a query
in that DB.
--- In delphi...@yahoogrou <mailto:delphi-en%40yahoogroups.com> ps.com,
"Perry Kappetein" <pkappet...@...> wrote:
>
> yes, your right.
> messed up my example
>
> it's in a access table, that gets loaded into VirtualTree (Soft-gems.net)
>
> I was trying to do it within virtualTree, but it's getting me nowhere.
>
[Non-text portions of this message have been removed]