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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:25:06+00:00 2026-05-12T11:25:06+00:00

i am connecting access to a mysql db. i need to put together two

  • 0

i am connecting access to a mysql db.

i need to put together two statements and make them into one.

for example:

SELECT 
  users.id,
  users.first,
  users.last,
  chavrusas.luser_type AS user_type,
  chavrusas.id, 
  users.title, 
  users.city, 
  users.state, 
  users.home_phone, 
  users.email
FROM users
INNER JOIN chavrusas 
  ON Users.id=chavrusas.luser_id
WHERE     ((chavrusas.ruser_id)='3166' and chavrusas.ended=false) 
  AND     (chavrusas.luser_type) <> (chavrusas.ruser_type)
  AND NOT ((chavrusas.luser_type)='teacher' AND (chavrusas.ruser_type)='student')
  AND NOT ((chavrusas.ruser_type)='teacher' AND (chavrusas.luser_type)='student'); 
UNION
SELECT  
  users.id, 
  users.first, 
  users.last, 
  chavrusas.ruser_type AS user_type, 
  chavrusas.id, 
  users.title, 
  users.city, 
  users.state, 
  users.home_phone, 
  users.email
FROM users
INNER JOIN chavrusas 
  ON Users.id=chavrusas.ruser_id
WHERE     ((chavrusas.luser_id)='3166' and chavrusas.ended=false)
  AND     (chavrusas.luser_type) <> (chavrusas.ruser_type)
  AND NOT ((chavrusas.luser_type)='teacher' AND (chavrusas.ruser_type)='student')
  AND NOT ((chavrusas.ruser_type)='teacher' AND (chavrusas.luser_type)='student')
ORDER BY 4;

Users is a query which is:

SELECT 
  tblusers.*,
  tblusershliach.*,
  tbluserstudent.*,
  tbluserstudentteacher.*,
  tbluserteacher.*
FROM
(
  (
    (tblusers 
     LEFT JOIN tblusershliach 
     ON tblusers.id = tblusershliach.shliach_user_id
    )
  LEFT JOIN tbluserstudent 
  ON tblusers.id = tbluserstudent.student_user_id
  )
LEFT JOIN tbluserstudentteacher
ON tblusers.id = tbluserstudentteacher.student_teacher_user_id
) 
LEFT JOIN tbluserteacher 
ON tblusers.id = tbluserteacher.teacher_user_id;

instead of using “Users” in the first statement, i just want to put them together into one statement

how do i do it?

  • 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-12T11:25:06+00:00Added an answer on May 12, 2026 at 11:25 am

    Your SQL statement includes a semi-colon before the UNION keyword. I’m not sure how Jet/ACE treats it, but I always thought the semi-colon meant “end of statement”. Discard it and see if your results are any different. I’m not at all confident that will fix your problem, but let’s make sure it’s not contributing.

    Update:
    I did some tests, and it looks like Jet/ACE just ignores a semi-colon within a UNION. I was barking up the wrong tree.

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

Sidebar

Related Questions

I need to access and download data from a MySQL database without connecting to
I make use of the Mydac components by devart (corelab) to access MySql from
i connecting to a access database with php and adodb. Strings with characters like
Access can open DBF (dBase) files, but instead of physically converting the data into
I need to connect to a remote MySQL database and have created the following
i have developed a php mysql website and now i want to access this
I've got an ms-access application that's accessing and ms-sql db through an ODBC connection.
Perhaps naively, I created a class (AdminDatabase) to handle connection to different MS-Access database
When connecting to a network share for which the current user (in my case,
I have someone connecting to my repository using the url (substituted the IP address):

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.