1

I'm not sure this is possible, but the code I tried using first is:

mysql_query ("CREATE TABLE My_table as ( SELECT * FROM CPE LEFT JOIN Greenwich_j20 ON CPE.cust_index = Greenwich_j20.cust_index LEFT JOIN Liverpool_j20 ON CPE.cust_index = Liverpool_j20.cust_index)")
 or die ("this certainly didn't work\n");

The query itself works fine, and the syntax for the table works fine, but the combination is what it really doesn't like. Does it have a problem creating a table from a left join query?

2
  • Should that AS really be there? Commented Apr 12, 2011 at 16:30
  • Hi Tomalak, I don't seem to get any error, just the "this certainly didn't work" when it dies Commented Apr 13, 2011 at 8:37

1 Answer 1

2

If there is any auto increment column in your existing tables that will be not remain auto_increment in the table to be created.

You could try by selecting columns instead of * there should be an error of column Ambiguous.

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

7 Comments

Should this have been a comment?
@Tomalak: I think should not you should give some reaction time.
@Shakti: Huh? I can't understand what you said. If you're implying that I should have waited for you to complete compiling your answer, then my response is that perhaps you shouldn't post your answer until it is an answer. It's not a race.
@Tomalak: That was not. I mean to say At the first sight what I thought I posted but another sight I take one another thing I posted that as well. I am not taking it like race. By the way in real life everything is race.
@Shakti: Sorry, I can't understand you. I think it's a language barrier between us.
|

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.