[SPTUsers] SQL Data Call
Barry Wiegan
bwiegan at scout.wisc.edu
Thu Sep 4 11:38:46 CDT 2003
Beth,
I think this should work for you:
Select Title, Url, Description from Resources, ResourceNameInts as A,
ResourceNameInts as B where Resources.ResourceId = A.ResourceId and
Resources.ResourceId = B.ResourceId and A.ControlledNameId = 100 and
B.ControlledNameId = 103;
Barry
--
Barry Wiegan
Sr. Software Engineer
Internet Scout Project
Madison, WI
bwiegan at scout.wisc.edu
Wakefield, Beth USA Contractor wrote:
> no, sorry it didn't work
> Beth
>
> -----Original Message-----
> *From:* Cornejo, Luis [mailto:lcornejo at dep.anl.gov]
> *Sent:* Wednesday, August 27, 2003 3:01 PM
> *To:* Wakefield, Beth USA Contractor ; sptusers at scout.wisc.edu
> *Subject:* RE: [SPTUsers] SQL Data Call
>
> Just modify you query just a little bit:
>
>
>
> SELECT p1.Resources.Title, p1.Resources.URL, p1.Resources.Description
> FROM ResourceNameInts as p1, ResourceNameInts as p2 INNER JOIN
> Resources ON p1.ResourceId = Resources.ResourceId
> WHERE (p1.ControlledNameId= '100') AND (p2.ControlledNameId='103')
>
>
>
>
>
> -Luis-
>
> -----Original Message-----
> *From:* Wakefield, Beth USA Contractor [mailto:ejwakefi at nps.navy.mil]
> *Sent:* Wednesday, August 27, 2003 12:51 PM
> *To:* sptusers at scout.wisc.edu
> *Subject:* [SPTUsers] SQL Data Call
>
>
>
>
>
> I'm trying to call some data out of SPT with a SQL statement like
> this one, I want data where ControlledNameId=100* AND* 103 not OR.
> This seems to be the problem.
>
> SELECT Resources.Title, Resources.URL, Resources.Description
> FROM ResourceNameInts INNER JOIN Resources ON
> ResourceNameInts.ResourceId = Resources.ResourceId
> WHERE (ResourceNameInts.ControlledNameId= '100') AND
> (ResourceNameInts.ControlledNameId='103')
>
> I also tried this: with no luck.
>
> SELECT Resources.Title, Resources.URL, Resources.Description
> FROM ResourceNameInts INNER JOIN Resources ON
> ResourceNameInts.ResourceId = Resources.ResourceId
> WHERE ResourceNameInts.ControlledNameId
> IN('100', '103')
> GROUP BY ResourceId
> Having Count(ResourceId)=2
>
> If someone can please help me with this query it would be greatly
> appreciated! Thanks in advance.
>
> Beth
>
>------------------------------------------------------------------------
>
>_______________________________________________
>SPTUsers mailing list
>SPTUsers at scout.wisc.edu
>http://scout.wisc.edu/mailman/listinfo/sptusers
>
>
More information about the SPTUsers
mailing list