SunQuest
           MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 13th, 2004, 08:37 AM
rknuppel rknuppel is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 8 rknuppel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to rknuppel Send a message via Yahoo to rknuppel
Query help..

Ok, here is what I have.

'Pictures' table with picturename field and keywords field
'PictureNames' table with Name field
'PictureNameEntries' table with NameID and PictureID fields

What I have now is a bunch of picture records stored in the 'Pictures' table. Currenlty the keywords field is empty! The 'PictureNames' table holds the names of every person in each of my pictures. Then the 'PictureNameEntries' holds entries that say which name is in which picture. There CAN be multiple names for each picture.

So, what I want to do is get all the names for each picture and insert them into the KEYWORDS field in the 'Pictures' table. Here is the query I started:


UPDATE pictures, picturenames, picturenameentries SET pictures.keywords=picturenames.Name WHERE picturenames.ID=picturenameentries.NameID AND pictures.ID=picturenameentries.PictureID

The problem with this query is that it ONLY GETS ONE NAME per picture. My question is: How can I get all of the entries from the 'picturenameentries' table and insert all of these into my keywords field (separated by a space).

Sorry this is so confusing. Anyone help me?

Thanks,
Ryan

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Query help..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway