J1 and J2 are aliases for two instances of the junk table. Since I am doing a 
sub-query, I need to differentiate between the two instances.

--- In [email protected], "Perry Kappetein" <pkappet...@...> wrote:
>
> Thank you, 
>  
> but what is  j1 and j2 ?
>  
> 
>   _____  
> 
> 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" <pkappetein@> 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]
>


Reply via email to