[thelist] SQL Assistance

Morgan Kelsey morgan at morgankelsey.com
Tue Apr 1 11:37:04 CST 2003


ert, that AS should be an =

AddressContactID = (SELECT TOP 1 id FROM Address WHERE AddressContactID =
ContactID)

<tip type="ColdFusion whitespace">
The cfsilent tag is the preferreed method for controlling whitespace, as it
has extremely low overhead.

cfsetting has a little more overhead, but also allows output to the page
within cfoutput blocks, and the processing of cfinclude tags.
</tip>


----- Original Message -----
From: "Morgan Kelsey" <morgan at morgankelsey.com>
To: <thelist at lists.evolt.org>
Sent: Tuesday, April 01, 2003 12:22 PM
Subject: Re: [thelist] SQL Assistance


> michelle,
>
> subquery to the rescue...
>
>
> > I've dummed down this query greatly in order to try to find a solution
to
> the > problem. The real query is far more complex .. but for simplicity
this
> shows > the problem we are encountering.  This is from the sql query
builder
> in
> > Access 2K.
>
> ah, well *there's* your problem, heh...query wizard...grumble grumble
>
> SELECT
> Contacts.ContactID,
> Module.ModuleContactID,
> Module.ModuleID,
> Module.Module,
> Address.AddressType,
> AddressContactID AS (SELECT TOP 1 id FROM Address WHERE AddressContactID =
> ContactID)
> FROM
> Contacts
> INNER JOIN [Module] ON Contacts.ContactID = Module.ModuleContactID
> WHERE (((Module.Module)="CO" Or (Module.Module)="COWEB"));
>
> TOP 1 may not be what you want, but you get the idea...
>
> did i really beat rudy to this one?
>
>
> nagrom
> http://morgankelsey.com
>
> --
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list