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

  • Home
  • SEARCH
  • 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 6836039
In Process

The Archive Base Latest Questions

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

A client requested me to perform some changes in an SQL query and sent

  • 0

A client requested me to perform some changes in an SQL query and sent me exactly the query he wanted. He usually works on msSql but says it should work also on MySql which is the platform i’m using.

This is the query :

INSERT INTO     Messages (Match, Message)
SELECT          [Match], MM.Message
FROM            MatchMessages AS MM
INNER JOIN  Matches AS M
ON      MM.ActionBy=M.ActionBy
AND     MM.Status=M.Status

I’m not sure where the insert get the correct values from the select and join, and how does it know where to enter which value. What is happening in this query? There is no VALUES anywhere and there are more selected values then targeted in the insert…

Does this query looks logical?

  • 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-26T23:18:24+00:00Added an answer on May 26, 2026 at 11:18 pm

    Yes – it is an absolutely normal query… Let’s break this down:

    Part one

    SELECT          [Match], MM.Message
    FROM            MatchMessages AS MM
    INNER JOIN  Matches AS M
    ON      MM.ActionBy=M.ActionBy
    AND     MM.Status=M.Status
    

    This gets executed first and returns 0-n rows of data… each row containing 2 columns (Match and Message) in this specific order. If you want just execute it standalone (exactly as it is here without the INSERT part).

    Part two

    INSERT INTO     Messages (Match, Message)
    

    This part gets fed the result of Part one (beware that this part does not know and does not care about the column names from Part one, it just acts on the order of columns)… which means for every row returned by Part one it does the equivalent of

    INSERT INTO Messages (Match, Message) VALUES (MatchFromPartOne, MessageFromPartOne)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am verifying my login authentication using ASP.net webservices. But the client requested to
cpp_netlib docs contains example HTTP client , but I see it works only in
I have a client who requested piano keys as links and he wants them
I get the following error: Client does not support authentication protocol requested by server;
Can a (||any) proxy server cache content that is requested by a client over
I'm writing an iPhone app for a client, and they have requested a feature
We are currently developing a server whereby a client requests interest in changes to
I'm attempting to perform a synchronous write/read in a demux-based client application with MINA
This is mostly an experiment , but I do think it does have some
I was recently requested by a client to build a website for their insurance

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.