473,414 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

create a temporary table

hi guys,

how could i create and send this
[HTML]SELECT d.name, d.missing, f.salario, (SELECT SUM(advanced) FROM data d2 WHERE d.name=d2.name) AS AdvanceSum from data d JOIN empregados f ON f.name = d.name where MONTH(d.date) = 4 group by name;[/HTML]
to a temporary table??
i have to add this select in a temporary table and make a calculation between the sum(advanced) and the f.salario but i have no idea of how to write the code...

thanks
May 5 '07 #1
1 1494
pbmods
5,821 Expert 4TB
hi guys,

how could i create and send this
[HTML]SELECT d.name, d.missing, f.salario, (SELECT SUM(advanced) FROM data d2 WHERE d.name=d2.name) AS AdvanceSum from data d JOIN empregados f ON f.name = d.name where MONTH(d.date) = 4 group by name;[/HTML]
to a temporary table??
i have to add this select in a temporary table and make a calculation between the sum(advanced) and the f.salario but i have no idea of how to write the code...

thanks
Expand|Select|Wrap|Line Numbers
  1. CREATE VIEW `View_PayrollOrWhatever` AS SELECT d.name, d.missing, f.salario, (SELECT SUM(advanced) FROM data d2 WHERE d.name=d2.name) AS AdvanceSum from data d JOIN empregados f ON f.name = d.name group by name;
  2.  
  3. CREATE TEMPORARY TABLE `Temp_Data_PayrollOrWhatever` SELECT * FROM `View_PayrollOrWhatever` where MONTH(d.date) = 4;
http://dev.mysql.com/doc/refman/5.0/en/create-view.html
http://dev.mysql.com/doc/refman/5.0/...ate-table.html (look towards the bottom)
May 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ezra epstein | last post by:
I found a post about something similar in an older release: http://archives.postgresql.org/pgsql-bugs/2002-08/msg00151.php Here's the issue. Inside a function I'm calling CREATE LOCAL TEMPORARY...
4
by: maricel | last post by:
Could someone confirm which tablespace is being used when running ALTER & CREATE INDEX. Is it the tempspace or the tablespace where the table resides? Many thanks, maricel
3
by: Wiggy | last post by:
Hi, It's probably easiest if I describe what I'm trying to do: I have several tables I want to base a query on. In addition I have some dynamic data that I want to join against that consists...
12
by: Doug Bell | last post by:
Hi, I am having problems trying to create a (temporary) DataTable from a selection from a DataGrid (dgOrders). dtOrdDetails is declared as a Public DataTable Sub is: Dim stFilter as String...
6
by: Peter Nurse | last post by:
For reasons that are not relevant (though I explain them below *), I want, for all my users whatever privelige level, an SP which creates and inserts into a temporary table and then another SP...
0
by: mktilu | last post by:
hi can any one give me a example to create temporary table in Stored procedure during run time and then delete the temporary table at the end of the stored procedure .its argent
2
by: prakashwadhwani | last post by:
I have an app with a Front End and a Back-End. My date field is INV_DATE I would like to copy all data with year(inv_date) 2005 to a temp table in both, the front end & the back end. How...
1
by: mpramodk | last post by:
Please find the code for creating a temporary table and access it in UDF functions. While we do this we obtain a compile time error stating "A declared temporary table cannot be used in...
9
by: DottingTheNet | last post by:
help plz!! when i try to cretae a table in a procedure like create procedure blah is begin create table..... ...... end;
3
by: DeanL | last post by:
Hi guys, Does anyone know of a way to create multiple tables using information stored in one table? I have a table with 4 columns (TableName, ColumnName, DataType, DataSize) and wanted to know...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.