Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6117359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:18:41+00:00 2026-05-23T15:18:41+00:00

I have a query that joins multiple tables. QString str1 = SELECT DISTINCT f.pk_file_ID,

  • 0

I have a query that joins multiple tables.

QString str1 = "SELECT DISTINCT f.pk_file_ID, f.file_name" 
" FROM"
" File_Properties f"
", Video v "
", Audio a"
", Transport_Stream ts"
", TS_Data tsd"
", Signal_Root sr"
", Test_Case tc"
" WHERE"
" v.fk_file_ID = f.pk_file_ID"
" AND a.fk_file_ID = f.pk_file_ID" 
" AND ts.fk_file_ID = f.pk_file_ID"
" AND tsd.fk_file_ID = f.pk_file_ID"
" AND sr.fk_file_ID = f.pk_file_ID"
" AND tc.fk_file_ID = f.pk_file_ID" + clause;

My app uses comboboxes that allow a user to select video file criteria which is used to fetched and display file data in a table. The selected criteria is stored in the clause variable and is used to retrieve the matching files in the database.

The problem here is that a video file can have 0 to many Audio and Video entries. If, for example, a file does not contain any Audio data, there is no entry made in the Audio table. Therefore, this join does not work for retrieving files that do not have an Audio/Video entry.

One way around this would be to make a blank record in the tables where a video file has no Audio/Video data. However, I don’t want to have blank records in the tables.

Is there a better way to join the tables?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:18:42+00:00Added an answer on May 23, 2026 at 3:18 pm

    Have a look at the Left outer Join. Values of the left (in this case file_properties) table are always displayed, even when they have no corresponding record in the right (in this case audio and video) table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MS SQL query that joins multiple tables and an example of
I have a query that pulls values from multiple tables. I want to order
I have a complex SQL query that joins multiple tables. Here's a watered down
I have a query that is getting counts from multiple tables by using a
I have a MySQL query that selects data from multiple tables and then orders
I have a query that is run once per minute, on multiple tables (with
I am extracting data from multiple tables. mt query is as follows: SELECT p.Record_Num
I have a query that has 7 inner joins (because a lot of the
I have a query that originally looks like this: select c.Id, c.Name, c.CountryCode, c.CustomerNumber,
I have a query that I'm executing from a .NET application to a SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.