Gary,
        Something like this

SELECT DISTINCT a.CategoryName
FROM Table(A) a, Table(B) b
WHERE a.CategoryId = b.CategoryID
AND b.ItemID = 20
        
Sunday, September 10, 2000, 8:43:45 PM, you wrote:

Gary> I am having a problem pulling what I want from a couple of tables and any
Gary> help would be greatly appreciated.  Find below a simple synopsis of the two
Gary> tables.

Gary> Table(A)
Gary> ---------
Gary> CategoryName           CategoryID
Gary> -----------                ------------
Gary> CategoryName1            1
Gary> CategoryName2            2
Gary> CategoryName3            3

Gary> Table(B)
Gary> ---------
Gary> CategoryID    ItemID
Gary> ------------    --------
Gary> 1                    20
Gary> 2                    20
Gary> 1                    20
Gary> 3                    35

Gary> CategoryID is the common key.  What I want to do is pull a list of
Gary> CategoryNames from Table(A) where the ItemID in Table(B)  = 20.  I want the
Gary> CategoryName returned once.  Every way that I have tried it, I get the
Gary> CategoryName repeated for each entry in Table(B).

Gary> Query:
Gary> SELECT a.CategoryName
Gary> FROM Table(A) a, Table(B) b
Gary> WHERE a.CategoryId = b.CategoryID
Gary> AND b.ItemID = 20

Gary> Results returned:                    Desired Results:
Gary> ----------------                     -----------------
Gary> CategoryName1                    CategoryName1
Gary> CategoryName1                    CategoryName2
Gary> CategoryName2

Gary> Again, any help would be greatly appreciated.

Gary> ------------------------------------------------------------------------------
Gary> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Gary> To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.


-- 
 Regards,
 Alex                            mailto:[EMAIL PROTECTED]


------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
  • Need H... Gary J. Groomer
    • R... Tom Muck
      • ... Gary J. Groomer
    • C... Michael J. Sammut -- Four Eyes Productions -- think | plan | create
      • ... Chris Montgomery
        • ... Michael J. Sammut -- Four Eyes Productions -- think | plan | create
          • ... Michael Sheldon
            • ... Raymond K. Camden
    • Alex Puritche

Reply via email to