2

So I have a SQL query with has the following structure:

CREATE TEMPORARY TABLE a
Select id, time
from t1 ;

CREATE TEMPORARY TABLE b
Select id, views
from t2 ;

Select a.id, a.time, b.views from a join b on a.id=b.id;

Which is saved in a .sql file that I want to read in pd.read_sql()

However, since there are multiple SQL statements it does not seem to work.

Any clues on where to look at?

Thanks

4
  • 1
    CREATE TEMPORARY TABLE a AS SELECT ... Missing as? Commented Nov 12, 2018 at 16:28
  • No, not for mysql Commented Nov 12, 2018 at 16:50
  • Duplicate/related? stackoverflow.com/questions/38646214/… Commented Nov 12, 2018 at 17:16
  • Different problem: my final query is the result of the merge of two temp tables Commented Nov 12, 2018 at 17:47

1 Answer 1

0

You need a "SET NOCOUNT ON" at the top of your script. This will avoid returning the empty result set for number of rows inserted by first 2 inserts.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.