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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:08:54+00:00 2026-05-24T07:08:54+00:00

I am using the MySql command tool to query a database from inside a

  • 0

I am using the MySql command tool to query a database from inside a Ruby script I wrote. However the need has arisen for a query that creates a temporary table, then in another query I need to perform a join on the temporary table. The only problem is every time I invoke mysql -h <host> -r <username> -D <database> -e "QUERY" I get a new transaction, so when I am trying to perform my join, the temporary table doesn’t exist anymore.

Is there anyway to do execute two separate queries in one invocation of the mysql command line tool??

Something like:
mysql -h <host> -r <username> -D <database> -e "QUERY1" -e "QUERY2"

Or is there some alternative way to store my queries? like in a text file or something?

Thanks

  • 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-24T07:08:54+00:00Added an answer on May 24, 2026 at 7:08 am

    Wouldn’t the “;” do the trick?

    mysql -h <host> -r <username> -D <database> -e "QUERY1;QUERY2"

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

Sidebar

Related Questions

I am trying to connect to a MySQL database using the mysql_connect() command however
Using Python2.4 I want to capture output from a mysql command. One caveat is
Using MySQL Administrator GUI tool I have exported some data tables retrieved from an
I'm using the MySQL command-line utility and can navigate through a database. Now I
My webapp is hosted on a unix server using MySQL as database. I wrote
I am trying to restore MySQL database data from a dump file, using C#
Using mysql directly from the command line (running on Ubuntu 9.10, standard bash terminal),
Is it possible to Export a MySQL to a CSV using the command line
Using MySQL , I can do something like: SELECT hobbies FROM peoples_hobbies WHERE person_id
Using MySQL syntax, how would I write a query to return the following (I

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.