Subject | Re: SELECT AS in a subquery |
---|---|
Author | dylanmarkow |
Post date | 2005-11-16T19:27:13Z |
That worked beautifully. Thanks!
--- In firebird-support@yahoogroups.com, Steve Wiser <steve@s...>
wrote:
--- In firebird-support@yahoogroups.com, Steve Wiser <steve@s...>
wrote:
>are
> what about:
>
> select count(*)
> from tblusers t1
> where exists (
> select project_manager
> from tblprojects
> where project_manager = t1.username )
>
> -steve
>
> On Wed, 2005-11-16 at 16:33 +0000, dylanmarkow wrote:
>
> > I have two tables, one with a column "USERNAME", the other with a
> > column "PROJECT_MANAGER." Some of the people under USERNAME are
> > also "Project Managers." I need to find out how many USERNAME's
> > also PROJECT_MANAGER's.each
> >
> > I tried this, but it said "Token Unknown - AS":
> >
> > SELECT COUNT(*) FROM TBLUSERS WHERE USERNAME IN (SELECT
> > PROJECT_MANAGER
> > AS USERNAME FROM TBLPROJECTS)
> >
> > If i remove the "AS USERNAME", it returns zero, since the fields
> > don't
> > match up.
> >
> > I'd like to avoid manually iterating through TBLUSERS, checking
> > user individually. Any suggestions?
> >
> >
> >
> >
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Visit http://firebird.sourceforge.net and click the Resources item
> > on the main (top) menu. Try Knowledgebase and FAQ links !
> >
> > Also search the knowledgebases at http://www.ibphoenix.com
> >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>