[AccessD] query select in column

pedro at plex.nl pedro at plex.nl
Thu Dec 29 17:21:15 CST 2011


Hello Gustav,

this gives me the result.

Thanks. You saved my sql day again.
Always good to know that i can fall back on accessd when i can't get the result that in want.

Pedro




In antwoord op:

> From: "Gustav Brock" <Gustav at cactus.dk>
> To: <accessd at databaseadvisors.com>
> Date: Thu, 29 Dec 2011 16:49:42 +0100
> Subject: Re: [AccessD] query select in column
> 
> 
> Hi Pedro
> 
> Perhaps a union query will do:
> 
> Select tbl2.pat, tbl2.opendate, tbl2.code from tbldialysis as tbl2
> inner join 
> (select distinct pat from tbldialysis where code=325) as tbl1 
> on tbl1.pat = tbl2.pat 
> where tbl2.code in (326,327)
> union all
> Select tbl2.pat, tbl2.opendate, tbl2.code from tbldialysis as tbl2 
> inner join 
> (select distinct pat from tbldialysis where code in (326,327) as tbl1 
> on tbl1.pat = tbl2.pat 
> where tbl2.code=325;
> 
> /gustav
> 
> 
> >>> pedro at plex.nl 29-12-2011 14:54 >>>
> Hello William,
> 
> I  made a second table with only the code=325 records in it.
> But i get an syntax-error when using the query;
> 
> Select tbl2.pat, tbl2.opendate, tbl2.code from tbldialysis as tbl2 inner
> join (select distinct pat from tbldialysis where code=325) as tbl1 on
> tbl1.pat = tbl2.pat and tbl2.code in (326,327);
> 
> i can't figure out why (after correction of misspelled words?
> 
> What am i doing wrong?
> 
> Pedro
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 


More information about the AccessD mailing list