[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

searching a database table where value of column is equal to value of a related table

Posted on 2009-03-29
1
Medium Priority
?
198 Views
Last Modified: 2012-05-06
hi,
i want to write a query that selects values in a table dependent on the value in a related table. i have a table that stores information about files and the info stored is a filename and a series of codes relating to data in other tables.
so for example i want to search for files in the fle table that has a certain composer but the composer information for the file is not stored in this table, it is stored under a song name column which is an id and has the composer id related to it.
so for the file i just pick a song name and this song name has an id as a link to song name table and within this song name table is a composer ID that links to the composer table. i hope this makes sense?

i want to search for a composer and bring up all data from the files table with this composer?

i have included code i have been trying but it does not work
i am running this query in vb 2008
SELECT     File.AssetFileName, File.AssetSource, [Song Name].[Song Code]
FROM         ((File INNER JOIN
                      [Song Name] ON File.[Song Code] = [Song or Tune].[Song Code]) INNER JOIN
                      Composer ON [Song name].[Composer Code] = Composer.[Composer Code])
WHERE     (Composer.[Composer Code] = '1')

Open in new window

0
Comment
Question by:kipl20
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
kipl20 earned 0 total points
ID: 24012988
no worries have worked it out
SELECT     File.AssetFileName, File.AssetSource, [Song Name].[Song Code]
FROM         ((File INNER JOIN
                      [Song Name] ON File.[Song Code] = [Song or Tune].[Song Code]) INNER JOIN
                      Composer ON [Song name].[Composer Code] = Composer.[Composer Code])
WHERE     (Composer.[Composer Code] = '1')

SELECT File.[AssetFilename],File.[AssetSource] 
FROM ((File INNER JOIN [Song Name] ON File.[SongCode] = [Song or Tune].[Song Code]) INNER JOIN Composer ON [Song Nsme].[Composer Code] = Composer.[Composer Code])
WHERE (Composer.[Composer Code] = " & vocalistcode & ")"

Open in new window

0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question