WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-30-2004, 03:52 PM
WildSeeker's Avatar
WebProWorld Member
 

Join Date: Nov 2003
Location: New York City
Posts: 32
WildSeeker RepRank 0
Default mySQL Query Needed

Greetings!

I need to run a query of my mySQL database, and do not wish to bother my developers with the task ... hoping somebody here can assist me with an appropriate query.

I have the following three tables:

'outfitters'
'outfitter_activities'
'outfitter_destinations'

Each record in the 'outfitters' table is to have at least one associated paired record from both the 'outfitter_activities' and 'outfitter_destinations' tables.

What has happened is that the key field ('outfitterID') that links all three of the tables has been changed in the 'outfitter' table for a number of records, without having correspoding changes made to the records in the related tables. This has resulted in many 'orphaned' records in the '_activities' and '_destinations' tables.

Most importantly, I would like to run a query that will show me all records in the 'outfitters' table that do not have corresponding records in the '_activities' and '_destinations' tables. Secondly, I would like to clean up the 'orphaned' records, so I would like to run a reverse query of the '_activities' and '_destinations' tables that will show me all records that do not have a related record in the 'outfitters' database. I hope this makes sense.

I Use phpMyAdmin to access my database.

Any help/suggestions would be greatly appreciated!
__________________
Regards,

Tim
WildSeeker
The Adventure Travel Resource
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: , ,



Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0