0

Hi,

I am using mysql 5.0.77.

I am running queries like

create table T1 as Select t1.arg0 as ARG0, t1.arg1 as ARG1, t2.arg0 as ARG3 from table t1, table t2 where t1.arg0=t2.arg0

I want to create the table if the select statement does not return an empty resultset.

If I first run the select statement and get number of rows returned and if it is greater than 0 run the

create table T1 as Select t1.arg0 as ARG0, t1.arg1 as ARG1, t2.arg0 as ARG3 from table t1, table t2 where t1.arg0=t2.arg0

statement, will select result be retrieved from the query cache or will it be re-executed?

I am using mysql C api and it has a function to return number of retrieved for a query.

Or any other suggestions?

thanks

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by smantscheff
0

It will come from cache if the data in the table did not get changed between your select and create as select statements.

To ensure that the number of records are >0 use
select count (*) not select *

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.