Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL
Hi,
 
I wonder if anyone would help me out here, I m trying to link tables together to get some information to produce a report. But i m new to sql so need some help completing this asap:
 
select * from tvdba.mdd_media, tvdba.mdd_containers, tvddba.mdd_media_contnrs_link
where m.media_id = l.media_id (+) --not sure here if i should do where media_id(media_id like '%' +....--
 
I want to join the query for starters!
 
So for example, i want to select the following items:
Media ID
Series Title
Format
Version
Location
Filename
Status
 
Any ideas how to go about this, would be very helpful, something to start me off.
 
Thanks in advance
Posted 22-Mar-13 3:40am
Edited 22-Mar-13 4:04am
v2
Comments
ThePhantomUpvoter at 22-Mar-13 8:49am
   
I am not at all sure what it is that you are asking. "select all the information and then add the data parameters to the where clause" makes no sense. What I am sure of though is that you want a JOIN in your query.
Geofferz at 22-Mar-13 9:02am
   
Yeah think didnt explain it properly there, i want to start with joining the query

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Join works basically like this:
 
SELECT TableA.*, TableB.*, TableC.*, TableD.*
FROM TableA TA
JOIN TableB TB
ON TA.aID = TB.aID
JOIN TableC TC
ON TA.cID = TC.cID
JOIN TableD TD
ON TA.dID = TD.dID
WHERE TA.media_id LIKE ...
  Permalink  
v2
Comments
Geofferz at 25-Mar-13 7:17am
   
Thanks Du

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 22 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100