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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:44:44+00:00 2026-06-04T08:44:44+00:00

I have two tables hello and login_table and below is their structure user_info ——-

  • 0

I have two tables hello and login_table and below is their structure

user_info
-------
some_id | name | address

login_table
-------
id | username | password

some_id and id are autoincrement indexes.

Now how can i use INSERT statement with INNER JOIN in SQL

at present, i want add below data with same some_id and id

`name` = John
`address` = wall street
`username` = john123
`password` = passw123

below code shows, what i have tried so far.

insert into login_table lt
INNER JOIN user_info ui ON ui.some_id = lt.id
(ui.name, ui.address, lt.username, lt.password) 
values
('John', 'wall street', 'john123', 'passw123')

And this is not the one value, i want to add more than one value at a time.. how can i achieve.

thanks for help.

  • 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-04T08:44:46+00:00Added an answer on June 4, 2026 at 8:44 am

    If you need to perform the two INSERT operations atomically, use a transaction:

    START TRANSACTION;
    INSERT INTO login_table (username, password) VALUES ('john123', 'passw123');
    INSERT INTO user_info (name, address) VALUES ('John', 'wall street');
    COMMIT;
    

    N.B. Your storage engine must support transactions for this to work (e.g. InnoDB).

    To insert multiple values into a table at once, use the multiple rows form of INSERT. As stated in the manual:

    INSERT statements that use VALUES syntax can insert multiple rows. To do this, include multiple lists of column values, each enclosed within parentheses and separated by commas. Example:

    INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);

    The values list for each row must be enclosed within parentheses. The following statement is illegal because the number of values in the list does not match the number of column names:

    INSERT INTO tbl_name (a,b,c) VALUES(1,2,3,4,5,6,7,8,9);

    VALUE is a synonym for VALUES in this context. Neither implies anything about the number of values lists, and either may be used whether there is a single values list or multiple lists.

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

Sidebar

Related Questions

Hello I have two mysql tables one that holds username and password second that
I have two tables, for example: Table A Table B ======= ======= Name |
I have two tables, the structure of the first partially recapitulates, iterates the structure
I basically have two tables: A(id int, name varchar(10), info varchar(10)) B(id int, item
I have two tables, Hello and World: Hello has two columns id(int) and id1(int,
I have two tables, like these: Table People: VARCHAR Name INTEGER Age Table Message
I basically have two tables: A(id int, name varchar(10), info varchar(10)) B(id int, item
Let's say I have two tables: TABLE A MessageID | Message 1 | Hello
I have two tables like this: Table Name: users emx | userid --------------- 1
i have two tables products and reviews each product has several reviews linked by

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.