Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i create a tomprary table in Mysql 1

Status
Not open for further replies.

naceur

Programmer
May 29, 2001
3
FR
Please help me.
1- How can i create a tomprary table in MySql?
2- How can i use 'count' with 'distinct' in MySql request?
 
What is the truble?(if you have some). I think you should study SQL. John Fill
1c.bmp


ivfmd@mail.md
 
1 - you can create a table and then delete it later if you want. There's no special kind of temporary table that I know of.

Do you know the routine for a create?

create table "tablename" (in here you fill in the column names and data types you want).

If this is new to you, it would in fact be good to look for an SQL tutorial. It's not hard to learn this kind of thing

Good Luck
 
Yes, MySQL can have temporary tables (please check documentation before giving answers).

Code:
CREATE TEMPORARY TABLE mytemptable (colunm stuff...);
This table will exist until your MySQL connection is dropped. Also, it's sometimes useful to create a temp table in memory, rather than on the disk, using the HEAP type:
Code:
CREATE TEMPORARY TABLE mytemptable (colunm stuff...etc...)TYPE=HEAP;
Since the table is only in RAM, queries will execute faster, and why use disk space if you aren't saving the table results?

Also see
 
well, I see there is a temp table in MySQL. Sorry, and thanks, rycamor, for the learning.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top