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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:29:23+00:00 2026-06-15T02:29:23+00:00

I have a database with entries similar to the following… users: +—–+——+———-+———+——-+ | UID

  • 0

I have a database with entries similar to the following…

users:
+-----+------+----------+---------+-------+
| UID | Name |  Addr    |  City   | State |
+-----+------+----------+---------+-------+
|   1 | John | 101 Main | Austin  | TX    |
|   2 | John | 101 Main | Houston | TX    |
|   3 | John | 101 Main | Del Rio | TX    |
|   4 | John | 101 Main | Houston | TX    |
+-----+------+----------+---------+-------+

verification:
+-----+---------------+--------------+
| UID | LicenseFirst3 | LicenseLast3 |
+-----+---------------+--------------+
|   1 |           554 |          122 |
|   2 |           556 |          345 |
|   3 |           555 |          382 |
|   4 |           555 |          108 |
+-----+---------------+--------------+

section_user_map:
+-----+-----------+---------------------+
| UID | SectionID |    CompleteDate     |
+-----+-----------+---------------------+
|   1 |        65 | 2012-05-12 05:05:15 |
|   2 |        72 | 2012-05-06 14:03:15 |
|   3 |        65 | 2012-05-09 16:13:15 |
|   4 |        72 | 2012-05-06 18:14:15 |
+-----+-----------+---------------------+

I need to be able to search for students who completed section 65 between noon on day X and noon on day Y. I also need to show the student’s name, address, city, state and first and last three digits of their license number. I believe this will require both a left join and union command but it’s getting a bit too complicated to formulate.

  • 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-15T02:29:24+00:00Added an answer on June 15, 2026 at 2:29 am
    SELECT *
    FROM   section_user_map
      JOIN users        USING (UID)
      JOIN verification USING (UID)
    WHERE  SectionID = 65
       AND CompleteDate BETWEEN '2012-05-09 12:00:00'
                            AND '2012-05-11 12:00:00'
    

    See it on sqlfiddle.

    No UNION required. Outer join would only be required if you still want to return results for users who do not exist in one (or both) of the users or verification tables.

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

Sidebar

Related Questions

I have a mysql database of entries with dates. So what I want is
I have a database in MySQL which have entries of time. There are more
I have a web application that dynamically loads assemblies based on database configuration entries
In my MySQL Database all the entries have a rating(an Integer). Now I want
I have to store millions of entries in a database. Each entry is identified
I have an html/php form that updates entries on the database server. I need
If I have about 250 entries with 6 columns in a MySQL database, and
Hello i have a question on picking random entries from a database. I have
Say I have a database table with three fields: id, content and timestamp. Entries
I have a database where I am trying to group together similar column values

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.