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 8891249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:41:31+00:00 2026-06-14T22:41:31+00:00

I am supposed to display drivers who have not been assigned a shift. I

  • 0

I am supposed to display drivers who have not been assigned a shift. I have joined the table through the primary key of the driver number. Here’s my code.

select distinct dr_drvname
from driver,shift
where dr_drvnum <> sh_drvnum;

I have made the driver numbers not equal in my code to show the ones not qualified but this code displays all the drivers.

  • 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-06-14T22:41:32+00:00Added an answer on June 14, 2026 at 10:41 pm

    In counterpoint to Justin’s answer, here’s a version using joins:

    SELECT d.dr_drvname
    FROM driver d
    LEFT JOIN shift s
              ON s.sh_drvnum = d.dr_drvnum
    WHERE s.sh_drvnum IS NULL
    

    In general, it’s preferable to always explicitly specify your joins, not to use the implicit-join syntax (comma-separated FROM clause).

    (but why are you prefixing columns with a -short- table prefix: 'dr_'? Including in the initial table? When you appear to have them prefixed with a slightly longer one anyways: 'drv'?)

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

Sidebar

Related Questions

I have a page that is supposed to display a larger version of an
I have a DataGridViewComboBoxColumn where I'm supposed to display different values than are selected,
I have this simple snippet with an ActionLink that is supposed to display some
I have the following code that is supposed to display 3 products when the
I have an ImageView subclass that is supposed to display a logo in the
I have code which is supposed to display an ad for 10 seconds, then
I have this function that I wrote that is supposed to display notifications: function
in my code responseText is not working. It is supposed to display, text entered
I have the following code which supposed to display a TreeView (the original code
I have some code here that is supposed change display: none to display: block

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.