Re: create multiple tables in a single query

2012-04-06 Thread Johan De Meersman
- Original Message - From: joe j joe.st...@gmail.com Good suggestion. But I am a perl/unix illiterate. However I may learn in them future-you never know! You're never too old to learn :-) http://tldp.org/LDP/abs/html/ -- Bier met grenadyn Is als mosterd by den wyn Sy die't

Re: create multiple tables in a single query

2012-04-05 Thread Johan De Meersman
- Original Message - From: Rick James rja...@yahoo-inc.com That sounds like the wrong way to design the schema. Why not have `country` as a column in a single table? Given that he got all the data for the new tables from existing ones, I was assuming he needed separate tables for

Re: create multiple tables in a single query

2012-04-05 Thread Johan De Meersman
- Original Message - From: joe j joe.st...@gmail.com /*STEP 2. from the dos prompt?*/ for x in UK ZA IN CN; do mysql -ujoe -p -e INSERT INTO `table_new` SELECT var1, var2`, (case when (country='${x}') then 1 else 0 end) AS citizen ,'${x}' AS ctry FROM `'${x}'_table` LEFT

Re: create multiple tables in a single query

2012-04-05 Thread joe j
Thanks, Johan. I run the script in Unix indeed-don't know why I said Dos:) The problem is caused (at least that is the sense I get, so far) when I use some conditional statements inside case when as: (case when (country='${x}' AND var2) then 1 else 0 end) The problem lies with the part, but

Re: create multiple tables in a single query

2012-04-05 Thread Jan Steinman
am trying to get is a script that runs through a list of country names (US, UK, NL, etc) and create tables for each one of them as above. Is this feasible in MySql? You can't create multiple tables with one statement; but you *can* put multiple statements on a single line. However, this does

Re: create multiple tables in a single query

2012-04-05 Thread joe j
Jan Steinman wrote If not, how 'bout the best of both worlds: create a UNIX (or perl) script that loops through the country names and creates an SQL script? That would be fast entering AND fast performing! Good suggestion. But I am a perl/unix illiterate. However I may learn in them future-you

Re: create multiple tables in a single query

2012-04-04 Thread Hal�sz S�ndor
2012/04/03 22:27 +0200, joe j So what I am trying to get is a script that runs through a list of country names (US, UK, NL, etc) and create tables for each one of them as above. Is this feasible in MySql? There are PROCEDUREs, and there is PREPARE. Look them up. -- MySQL General Mailing List

Re: create multiple tables in a single query

2012-04-04 Thread Johan De Meersman
- Original Message - From: joe j joe.st...@gmail.com So what I am trying to get is a script that runs through a list of country names (US, UK, NL, etc) and create tables for each one of them as above. Is this feasible in MySql? You can't create multiple tables with one statement

Re: create multiple tables in a single query

2012-04-04 Thread joe j
to get is a script that runs through a list of country names (US, UK, NL, etc) and create tables for each one of them as above. Is this feasible in MySql? You can't create multiple tables with one statement; but you *can* put multiple statements on a single line. However, this does nothing

Re: create multiple tables in a single query

2012-04-04 Thread Rick James
That sounds like the wrong way to design the schema. Why not have `country` as a column in a single table? On 4/3/12 6:22 PM, Hal?sz S?ndor wrote: 2012/04/03 22:27 +0200, joe j So what I am trying to get is a script that runs through a list of country names (US, UK, NL, etc) and create

Re: create multiple tables in a single query

2012-04-04 Thread joe j
Thanks to Rick I would go for a single table. I tried the following, but hasn't been successful yet. First I created one 'master' table for one country, with a country column (ctry) as Rick suggested, then I tried to use the loop suggested by Johan to insert the records for each of the remaining

Disk space ending with multiple tables

2011-10-28 Thread a bv
Hi, I have a phpsyslog-ng box with different tables and disk usage is growing so fast nearly no space left. How must i move the old files ? Is it ok to move just like an ordinary file or do something on mysql? Regards -- MySQL General Mailing List For list archives:

Re: Disk space ending with multiple tables

2011-10-28 Thread Johan De Meersman
- Original Message - From: a bv vbavbal...@gmail.com I have a phpsyslog-ng box with different tables and disk usage is I assume that means you have a syslog service that logs to a MySQL database? growing so fast nearly no space left. How must i move the old files? Is it ok to

import xml data to multiple tables in mysql

2011-10-25 Thread Peng Yu
Hi, I have some xml data following the following DTD. It seems that it is better to import the xml file into multiple table, for example, author table, journal table. I read the mysql manual section on load xml, but I don't see how to load xml in multiple table and how to design the schema

Help needed on query on multiple tables

2010-06-03 Thread Michael Stroh
Hi everyone. I'm trying to create a certain MySQL query but I'm not sure how to do it. Here is a stripped down version of the result I'm aiming for. I'm pretty new to queries that act on multiple tables, so apologize if this is a very stupid question. I have one table (data) that has two

RE: Help needed on query on multiple tables

2010-06-03 Thread Steven Staples
To: MySql Subject: Help needed on query on multiple tables Hi everyone. I'm trying to create a certain MySQL query but I'm not sure how to do it. Here is a stripped down version of the result I'm aiming for. I'm pretty new to queries that act on multiple tables, so apologize

Re: Help needed on query on multiple tables

2010-06-03 Thread Michael Stroh
-Original Message- From: Michael Stroh [mailto:st...@astroh.org] Sent: June 3, 2010 11:24 AM To: MySql Subject: Help needed on query on multiple tables Hi everyone. I'm trying to create a certain MySQL query but I'm not sure how to do it. Here is a stripped down version

RE: Help needed on query on multiple tables

2010-06-03 Thread Steven Staples
...@astroh.org] Sent: June 3, 2010 11:55 AM To: Steven Staples Cc: 'MySql' Subject: Re: Help needed on query on multiple tables Thanks! That did it perfectly! Michael On Jun 3, 2010, at 11:45 AM, Steven Staples wrote: How about this? SELECT `first_table`.`names

Re: INSERT INTO multiple tables

2010-04-13 Thread Chris W
with this solution, I would love to read it. Again, thank you for your response. Gary Michael Dykman mdyk...@gmail.com wrote in message news:s2p814b9a821004121404ge4415a07tbb2ab1bbba1fd...@mail.gmail.com... It is not a question of multiple tables, it is a question of multiple statements. Most PHP

Re: INSERT INTO multiple tables

2010-04-13 Thread Gary
response. Gary Michael Dykman mdyk...@gmail.com wrote in message news:s2p814b9a821004121404ge4415a07tbb2ab1bbba1fd...@mail.gmail.com... It is not a question of multiple tables, it is a question of multiple statements. Most PHP configurations prohibit the application of more than one

Re: INSERT INTO multiple tables

2010-04-13 Thread Gary
Chris. Thanks for your response. I read somewhere that the mysqli was better, so I have been using it. This exercise is an experiment, on my local machine only, so I ommitted any escape functions. I am trying to create DB's with multiple tables, so it is totally a learning exercise. So

Re: INSERT INTO multiple tables

2010-04-12 Thread Gary
://php.net/manual/en/mysqli.multi-query.php ~viraj On Sun, Apr 11, 2010 at 10:27 PM, Gary gwp...@ptd.net wrote: I am experimenting with multiple tables, it is only a test that is my local machine only. This is the current code, which does not work , I have tried to concatonate the insert

Re: INSERT INTO multiple tables

2010-04-12 Thread Michael Dykman
It is not a question of multiple tables, it is a question of multiple statements. Most PHP configurations prohibit the application of more than one statement per call to execute. This is generally thought to be a security issue as the vast majority of simple PHP-based SQL injection attacks only

Re: INSERT INTO multiple tables

2010-04-12 Thread Gary
... It is not a question of multiple tables, it is a question of multiple statements. Most PHP configurations prohibit the application of more than one statement per call to execute. This is generally thought to be a security issue as the vast majority of simple PHP-based SQL injection attacks only

Re: INSERT INTO multiple tables

2010-04-12 Thread Colin Streicher
with this solution, I would love to read it. Again, thank you for your response. Gary Michael Dykman mdyk...@gmail.com wrote in message news:s2p814b9a821004121404ge4415a07tbb2ab1bbba1fd...@mail.gmail.com... It is not a question of multiple tables, it is a question of multiple statements. Most PHP

INSERT INTO multiple tables

2010-04-11 Thread Gary
I am experimenting with multiple tables, it is only a test that is my local machine only. This is the current code, which does not work , I have tried to concatonate the insert statements. I have tried multiple $query variables, but it is just overwriting itself (only the last one gets inserted

Re: INSERT INTO multiple tables

2010-04-11 Thread viraj
is it mysqli query or 'multi_query'? http://php.net/manual/en/mysqli.multi-query.php ~viraj On Sun, Apr 11, 2010 at 10:27 PM, Gary gwp...@ptd.net wrote: I am experimenting with multiple tables, it is only a test that is my local machine only. This is the current code, which does not work , I

Re: INSERT INTO multiple tables

2010-04-11 Thread Colin Streicher
/mysqli.multi-query.php ~viraj On Sun, Apr 11, 2010 at 10:27 PM, Gary gwp...@ptd.net wrote: I am experimenting with multiple tables, it is only a test that is my local machine only. This is the current code, which does not work , I have tried to concatonate the insert statements. I have

Re: Selecting data from multiple tables

2009-11-18 Thread Shawn Green
Ashley M. Kirchner wrote: Hi folks, I'm trying to, possibly do the impossible here. I have to select data from 4 different tables to come up with the right information and I'm having one heck of time trying to figure it out. This is going to be a long email ... Table_1:

Selecting data from multiple tables

2009-11-15 Thread Ashley M. Kirchner
Hi folks, I'm trying to, possibly do the impossible here. I have to select data from 4 different tables to come up with the right information and I'm having one heck of time trying to figure it out. This is going to be a long email ... Table_1:

RE: Selecting data from multiple tables

2009-11-15 Thread Gavin Towey
Table_1.username != 'dopey'; Regards, Gavin Towey -Original Message- From: Ashley M. Kirchner [mailto:kira...@gmail.com] Sent: Sunday, November 15, 2009 4:38 AM To: mysql@lists.mysql.com Subject: Selecting data from multiple tables Hi folks, I'm trying to, possibly do the impossible here

Re: Is It Possible to create a Join with Multiple Tables

2009-09-29 Thread Shawn Green
c...@hosting4days.com wrote: :Newbie: Short Question: Is it possible to create an inner join (or another join) with multiple tables? something like $query_list1 = SELECT table1.id,table1.status, table2.id, table3.id (more here - etc.) FROM table1 INNER JOIN table2 ON table1.id = table2.id

Re: Is It Possible to create a Join with Multiple Tables

2009-09-26 Thread Arthur Fuller
) with multiple tables? something like $query_list1 = SELECT table1.id,table1.status, table2.id, table3.id (more here - etc.) FROM table1 INNER JOIN table2 ON table1.id = table2.id INNER JOIN table3 ON table2.id = table3.id WHERE table1.status = 'open'; Q: Is something like this possible

Is It Possible to create a Join with Multiple Tables

2009-09-25 Thread c...@hosting4days.com
:Newbie: Short Question: Is it possible to create an inner join (or another join) with multiple tables? something like $query_list1 = SELECT table1.id,table1.status, table2.id, table3.id (more here - etc.) FROM table1 INNER JOIN table2 ON table1.id = table2.id INNER JOIN table3 ON table2

query and insert data on multiple tables

2009-02-13 Thread PJ
I am trying to create a php-mysql page to POST new records to several tables from one php page and I have to retrieve records from several (like 4 to 8) tables in one query. Being quite new to php mysql, I am wondering what is the best way to go about this. My tables consist of * Structure

Re: query and insert data on multiple tables

2009-02-13 Thread Baron Schwartz
Hi, On Fri, Feb 13, 2009 at 4:52 PM, PJ af.gour...@videotron.ca wrote: I am trying to create a php-mysql page to POST new records to several tables from one php page and I have to retrieve records from several (like 4 to 8) tables in one query. Being quite new to php mysql, I am wondering

Combining Multiple Tables

2008-09-26 Thread Tim Carty
I would like to combine multiple tables into a single table. I can create a UNION between tables with similar columns ­ cols A, B, and C from table_1 with cols A, B, and C from Table_2. What I can¹t figure out is how to add additionals columns (D, E, F) from table_2 if the columns don¹t exist

RE: Combining Multiple Tables

2008-09-26 Thread Weston, Craig (OFT)
the e-mail from your system. -Original Message- From: Tim Carty [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2008 10:41 AM To: mysql@lists.mysql.com Subject: Combining Multiple Tables I would like to combine multiple tables into a single table. I can create a UNION between

Re: Combining Multiple Tables

2008-09-26 Thread Thomas Pundt
On Friday, 26. September 2008, Tim Carty wrote: | I would like to combine multiple tables into a single table. I can create a | UNION between tables with similar columns ­ cols A, B, and C from table_1 | with cols A, B, and C from Table_2. What I can¹t figure out is how to add | additionals

Query multiple tables

2008-04-25 Thread Velen
Hi, I have 4 tables and need to use 1 query for displaying : prodbarcode,prod_description,stock_on_hand,qty, (qty-stock_on_hand) Variance, cost_price, (Variance*cost_price) Var_Amount for a specific store in StCount. StCount contains several sessionid for 1 store. C_Sess contains all the

full text search on multiple tables

2008-01-09 Thread nikos
Hello list I have to make a full text search and I want to do it in many tables. I have deferent tables for books authors and news. Any ideas how to do it? Thank you Nikos

Re: full text search on multiple tables

2008-01-09 Thread Sebastian Mendel
nikos schrieb: Hello list I have to make a full text search and I want to do it in many tables. I have deferent tables for books authors and news. Any ideas how to do it? three separate queries or an UNION -- Sebastian -- MySQL General Mailing List For list archives:

Re: full text search on multiple tables

2008-01-09 Thread Baron Schwartz
On Jan 9, 2008 8:36 AM, Sebastian Mendel [EMAIL PROTECTED] wrote: nikos schrieb: Hello list I have to make a full text search and I want to do it in many tables. I have deferent tables for books authors and news. Any ideas how to do it? three separate queries or an UNION Or a Boolean

Re: full text search on multiple tables

2008-01-09 Thread nikos
That is a grate solution. The problem is that I must have deferent links for each response. That's the tricky thing! Thank you Sebastian Mendel wrote: nikos schrieb: Hello list I have to make a full text search and I want to do it in many tables. I have deferent tables for books authors and

R: full text search on multiple tables

2008-01-09 Thread Nanni Claudio
FROM News T1 WHERE TITLE like '%..whatever..' OR CONTENT like '%..whatever..' Aloha! Claudio Nanni -Messaggio originale- Da: nikos [mailto:[EMAIL PROTECTED] Inviato: mercoledì 9 gennaio 2008 14.21 A: mysql@lists.mysql.com Oggetto: full text search on multiple tables Hello

Finding a value in multiple tables

2007-07-31 Thread David Ruggles
I need to find a userid across several different tables. What is the best way to do this? For example I have three tables TableA TableB TableC They all have a field id I want to find the value 123 in the field id in any one of these tables. Thanks, David Ruggles CCNA MCSE (NT) CNA A+ Network

Re: Finding a value in multiple tables

2007-07-31 Thread Wm Mussatto
On Tue, July 31, 2007 8:52, David Ruggles said: I need to find a userid across several different tables. What is the best way to do this? For example I have three tables TableA TableB TableC They all have a field id I want to find the value 123 in the field id in any one of these

RE: Finding a value in multiple tables

2007-07-31 Thread Chris Boget
I want to find the value 123 in the field id in any one of these tables. SELECT id FROM TableA WHERE id = 123 UNION SELECT id FROM TableB WHERE id = 123 UNION SELECT id FROM TableC WHERE id = 123 Please note that UNION requires that the same number (and type?) of fields be selected from each

RE: Finding a value in multiple tables

2007-07-31 Thread David Ruggles
[mailto:[EMAIL PROTECTED] Sent: Tuesday, July 31, 2007 11:56 AM To: mysql@lists.mysql.com Subject: Re: Finding a value in multiple tables On Tue, July 31, 2007 8:52, David Ruggles said: I need to find a userid across several different tables. What is the best way to do this? For example I have

Insert into multiple tables using auto_increment reference

2007-06-11 Thread Hamish Allan
Hi, Is it possible to insert values into two tables simultaneously and have the value of one of the columns in the second table be the auto_increment value from inserting into the first? E.g. if table1 has an auto_increment column c1, the logic I'm looking for would be something like: INSERT

Re: Insert into multiple tables using auto_increment reference

2007-06-11 Thread Baron Schwartz
Hi, Hamish Allan wrote: Hi, Is it possible to insert values into two tables simultaneously and have the value of one of the columns in the second table be the auto_increment value from inserting into the first? No, because you can only insert into one table at a time. But you can write a

Re: Insert into multiple tables using auto_increment reference

2007-06-11 Thread Hamish Allan
On 6/11/07, Baron Schwartz [EMAIL PROTECTED] wrote: Hi, Hamish Allan wrote: Hi, Is it possible to insert values into two tables simultaneously and have the value of one of the columns in the second table be the auto_increment value from inserting into the first? No, because you can only

mysql 4.11, left joins, multiple tables

2007-03-12 Thread Andrew Wallace
Hi - I'm having an issue with left joins and multiple tables. I have a table which is a fairly simple name-value pair table: create table { acnt char(20), item char(40), value char (60) } I want to pull out all of a subset of the values for a particular account. It works for two

The UPDATE efficiency is too slow when c overing multiple tables

2007-03-08 Thread lm761104
I run a SQL statement about UPDATE covering multiple tables, i feel that it is too slowly. SQL statement: update b_bb,tempdb set b_bb.zrk1=tempdb.num where b_bb.dwdm=concat(tempdb.shengbm,tempdb.shibm,tempdb.xianbm,tempdb.xiangbm,tempdb.cunbm); I modify the JOIN syntax like this: update

Re: Update multiple tables strange behaviour

2007-02-19 Thread Manuel Vacelet
2007/2/15, Manuel Vacelet [EMAIL PROTECTED]: Hi all, I'm facing a strange behaviour with an UPDATE statement. I have a table like: +-+--+ | item_id | rank | +-+--+ |2812 |2 | | 13050 |4 | | 13051 |3 | | 13052 |1 | +-+--+ And I want

Update multiple tables strange behaviour

2007-02-15 Thread Manuel Vacelet
Hi all, I'm facing a strange behaviour with an UPDATE statement. I have a table like: +-+--+ | item_id | rank | +-+--+ |2812 |2 | | 13050 |4 | | 13051 |3 | | 13052 |1 | +-+--+ And I want to switch items 2812 and 13052 rank (i.e.

Re: Grant privs to multiple tables at once?

2006-10-13 Thread Stephen Cook
blind because I don't see anything in the manual or in the MySQL book on granting to multiple tables at once and the * wildcard appears to only work by itself, not when appended to a string (i.e. I can't do grant select on biggie.foo_* to 'foouser'...). I've tried multiple variations of wildcards

Grant privs to multiple tables at once?

2006-10-12 Thread David Felio
Assume database 'biggie' with 15 tables, 10 of which start with 'foo_'. I want the user 'foouser' to have access only to those tables that begin with 'foo_'. I'm hoping that I am just being blind because I don't see anything in the manual or in the MySQL book on granting to multiple tables

Re: Grant privs to multiple tables at once?

2006-10-12 Thread Anders Lundgren
of which start with 'foo_'. I want the user 'foouser' to have access only to those tables that begin with 'foo_'. I'm hoping that I am just being blind because I don't see anything in the manual or in the MySQL book on granting to multiple tables at once and the * wildcard appears to only work

Re: Grant privs to multiple tables at once?

2006-10-12 Thread David Felio
because I don't see anything in the manual or in the MySQL book on granting to multiple tables at once and the * wildcard appears to only work by itself, not when appended to a string (i.e. I can't do grant select on biggie.foo_* to 'foouser'...). I've tried multiple variations

Query multiple tables

2006-07-02 Thread Neil Tompkins
Hi, How do I query multiple tables. For example I have TableName Accommodation Field1 AccommodationID Field2 AccommodationName I also have TableName Attractions Field1AttractionID Field2 AttractionName Field3

Re: Query multiple tables

2006-07-02 Thread Peter Brawley
attractions AS at USING (attractionid); PB - Neil Tompkins wrote: Hi, How do I query multiple tables. For example I have TableName Accommodation Field1 AccommodationID Field2 AccommodationName I also have TableName Attractions Field1AttractionID Field2

Joining multiple tables with grouping functions

2006-05-26 Thread Ville Mattila
Hello all, I'm sure that this situation is one of the most wondered questions with JOIN clauses. Anyway, I couldn't find any clear information how to carry out multiple joins in one query with proper results. I have four tables: 1. Invoices 2. InvoiceContents 3. Customers 4. Payments I try to

Re: Joining multiple tables with grouping functions

2006-05-26 Thread Peter Brawley
Ville, SELECT Invoices.*, SUM(InvoiceContents.Amount * InvoiceContents.Price) AS InvoiceTotal, Customers.Name, SUM(Payments.Amount) PaidTotal, MAX(Payments.Date) LastPayment FROM Invoices LEFT JOIN InvoiceContents ON (InvoiceContents.InvoiceID = Invoices.ID) LEFT JOIN Customers ON (Customers.ID

Re: Joining multiple tables with grouping functions

2006-05-26 Thread Jay Pipes
Ville Mattila wrote: I try to get a list of all Invoices with total sum of the invoice and paid sum of each invoices, as well as a customer name. I try following query: SELECT Invoices.*, SUM(InvoiceContents.Amount * InvoiceContents.Price) AS InvoiceTotal, Customers.Name, SUM(Payments.Amount)

LEFT JOIN Multiple Tables

2006-05-22 Thread Scott Baker
I have four tables that I join to get one record set about a customer. They are: UserInfo, ExtraAddr, DslInfo, and DslExtra. Specifically the main tables are joined with: SELECT * FROM UserInfo u, DslInfo d WHERE u.UserID = d.UserID; I've been adding more data to other tables and LEFT JOINING

Re: LEFT JOIN Multiple Tables

2006-05-22 Thread Peter Brawley
Scott SELECT * FROM UserInfo u, DslInfo d LEFT JOIN DslExtra e ON d.DslID = e.DslID LEFT JOIN ExtraAddr a ON a.UserID = u.UserID WHERE u.UserID = d.UserID; However it appears this syntax is not valid in MySQL 5.x Right, as the 5.x docs say, 5.x wants ISO-compatible explicit joins, ie SELECT *

Re: LEFT JOIN Multiple Tables

2006-05-22 Thread Scott Baker
Perfect. This is exactly what I needed. Is there some place I get some more documentation on the specifics of the ISO-compatible queries? Might save me some hair-pulling-out in the future. Scott Peter Brawley wrote: Scott SELECT * FROM UserInfo u, DslInfo d LEFT JOIN DslExtra e ON d.DslID =

Re: LEFT JOIN Multiple Tables

2006-05-22 Thread Peter Brawley
Scott, Perfect. This is exactly what I needed. Is there some place I get some more documentation on the specifics of the ISO-compatible queries? Might save me some hair-pulling-out in the future. See 'Changes in 5.0.12' on the Joins manual page

Update multiple tables

2006-03-27 Thread Mike Blezien
Hello, I'm alittle unclear on how too update multiple tables. We have two tables with the same column name: account.state account_service.state when we update the account table, we also need to update the account_service table with the same value for the 'state' column. Can this be done

Re: Update multiple tables

2006-03-27 Thread Rhino
- Original Message - From: Mike Blezien [EMAIL PROTECTED] To: MySQL List mysql@lists.mysql.com Sent: Monday, March 27, 2006 3:39 PM Subject: Update multiple tables Hello, I'm alittle unclear on how too update multiple tables. We have two tables with the same column name

Re: Update multiple tables

2006-03-27 Thread SGreen
Mike Blezien [EMAIL PROTECTED] wrote on 03/27/2006 03:39:15 PM: Hello, I'm alittle unclear on how too update multiple tables. We have two tables with the same column name: account.state account_service.state when we update the account table, we also need to update

Re: select from multiple tables

2006-03-18 Thread Peter Brawley
Miguel What i need is to list all the products and show the type name of each of them. What you need is a join (http://dev.mysql.com/doc/refman/5.0/en/join.html), eg: SELECT t.id, t.id_type, t.name, t.desc, t.price, p.name FROM tbl AS t INNER JOIN products AS p USING (id) PB -

select from multiple tables

2006-03-17 Thread Miguel Vaz
Hi guys, I am kinda new to mysql and on my endeavour to build a backend for a site i am building, i need to fetch data from a couple of tables, but dont know how to do it with a single select. Heres the problem: first table (products): id id_type

Re: Droping multiple tables by a pattern in the table name

2006-01-18 Thread Gleb Paharenko
multiple tables in one or few queries. I don't have an easy way to predict their names (I have a way to find their names, but it's by using software and I prefer doing it with mysql). All of the table names have a fixed part which I know, and I thought of using the fixed, known part of the names

Droping multiple tables by a pattern in the table name

2006-01-17 Thread Yair Zohar
Hello, I'm using mysql 4.1.14-standard. I would like to drop multiple tables in one or few queries. I don't have an easy way to predict their names (I have a way to find their names, but it's by using software and I prefer doing it with mysql). All of the table names have a fixed part which I

Problem with UPDATE syntax when updating multiple tables

2005-12-15 Thread Matthew Batt
Hi I need to update the 'products_id' field (shown below) by copying data from a separate table but I can't use the 'UPDATE' query as each 'product_id' entry relates to a specific 'products_model' row. id / assembly_no / products_id / products_model 1 / 2313 / *** / CASEACERENTRY2 2 / 2313 /

Re: Problem with UPDATE syntax when updating multiple tables

2005-12-15 Thread Gleb Paharenko
Hello. Please, could you provide the CREATE statement for you tables and describe the relationships between their fields (it will be good if you include sample data as well). Matthew Batt wrote: Hi I need to update the 'products_id' field (shown below) by copying data from a

Complex select across multiple tables

2005-11-16 Thread Scott Haneda
Some of these tables are rather large, I would put the schema in there, but I think it just adds to the mess. Tables `users` field id is auto inc pk `orders` field id is auto inc pk `products` field id is auto inc pk `order_items` field order_id is the key for hooking up order_items to orders,

Re: Complex select across multiple tables

2005-11-16 Thread SGreen
Scott Haneda [EMAIL PROTECTED] wrote on 11/16/2005 05:44:05 AM: Some of these tables are rather large, I would put the schema in there, but I think it just adds to the mess. Tables `users` field id is auto inc pk `orders` field id is auto inc pk `products` field id is auto inc pk

RE: Inserting information into multiple tables and problems

2005-09-21 Thread Todd Hewett
todd hewett wrote: mysql INSERT INTO BOARD_SERIAL_NUMBER (BOARD_SERIAL_NUMBER) mysql VALUES(36534); ERROR 1216: Cannot add a child row: a foreign key constraint fails Can you please post the output of: SHOW CREATE TABLE BOARD_SERIAL_NUMBER; mysql SHOW CREATE TABLE

Inserting information into multiple tables and problems

2005-09-20 Thread Todd Hewett
Howdy Folks I hope this is not too much information. I have mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386) I have multiple tables. All are innoD Tables. All AI on a Primary key integer All Columns are varchar 255 that are not keys. Table VCS_PO_NUMBER Has

Re: Inserting information into multiple tables and problems

2005-09-20 Thread Jasper Bryant-Greene
Todd Hewett wrote: I currently am failing with the following: mysql INSERT INTO VCS_PO_NUMBER (VCS_PO_NUMBER) VALUES(899234), - INSERT INTO BOARD_SERIAL_NUMBER (BOARD_SERIAL_NUMBER) VALUES(36534), - INSERT INTO BOARD_TYPE (BOARD_TYPE) VALUES(INPUT MODULE N12310), - INSERT INTO

Re: Inserting information into multiple tables and problems

2005-09-20 Thread Todd Hewett
SNIP--- You need to end each INSERT INTO statement with a semicolon (;), not a comma (,). Also pressing enter after each one will allow you to easier diagnose any problems that might come up. - I have

Re: Inserting information into multiple tables and problems

2005-09-20 Thread Jasper Bryant-Greene
Todd Hewett wrote: mysql INSERT INTO BOARD_SERIAL_NUMBER (BOARD_SERIAL_NUMBER) mysql VALUES(36534); ERROR 1216: Cannot add a child row: a foreign key constraint fails Can you please post the output of: SHOW CREATE TABLE BOARD_SERIAL_NUMBER; mysql INSERT INTO BOARD_TYPE (BOARD_TYPE)

RE: Inserting information into multiple tables and problems

2005-09-20 Thread todd hewett
mysql INSERT INTO BOARD_SERIAL_NUMBER (BOARD_SERIAL_NUMBER) mysql VALUES(36534); ERROR 1216: Cannot add a child row: a foreign key constraint fails Can you please post the output of: SHOW CREATE TABLE BOARD_SERIAL_NUMBER; mysql INSERT INTO BOARD_TYPE (BOARD_TYPE) VALUES(INPUT MODULE

Re: Inserting information into multiple tables and problems

2005-09-20 Thread Jasper Bryant-Greene
todd hewett wrote: mysql INSERT INTO BOARD_SERIAL_NUMBER (BOARD_SERIAL_NUMBER) mysql VALUES(36534); ERROR 1216: Cannot add a child row: a foreign key constraint fails Can you please post the output of: SHOW CREATE TABLE BOARD_SERIAL_NUMBER; mysql SHOW CREATE TABLE

DB Export multiple tables to CSV

2005-03-03 Thread H Ba
I have multiple tables set up and need to export these to csv in order to import them into Excel. Since all tables are related to each other and I can only export one at a time, is there a way to somehow get a readable file after importing into Excel, which non-programmers can edit and use

Re: DB Export multiple tables to CSV

2005-03-03 Thread SGreen
H Ba [EMAIL PROTECTED] wrote on 03/03/2005 02:14:57 PM: I have multiple tables set up and need to export these to csv in order to import them into Excel. Since all tables are related to each other and I can only export one at a time, is there a way to somehow get a readable file after

RE: DB Export multiple tables to CSV

2005-03-03 Thread Dathan Pattishall
multiple tables to CSV I have multiple tables set up and need to export these to csv in order to import them into Excel. Since all tables are related to each other and I can only export one at a time, is there a way to somehow get a readable file after importing into Excel, which non

Re: DB Export multiple tables to CSV

2005-03-03 Thread H Ba
multiple tables which relate to each other and import them into Excel, so a normal (Excel-)User can work with the data, like copying adresses or just looking at it, etc. Have a great day, Ho. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: INNER JOIN across multiple tables appear very slow.

2005-01-24 Thread Jigal van Hemert
From: Michael Stassen 2) In general, you should'nt put things in the JOIN condition which are not part of the JOIN criteria. For example, the condition c.salescode = '$salescode_param' is a restriction on which rows in c to consider, not a condition of the JOIN to t or tt, so it belongs in

Re: INNER JOIN across multiple tables appear very slow.

2005-01-23 Thread Michael Stassen
sam wun wrote: sam wun wrote: Hi, Can anyone tell me how to optimize the following sql statement? $sql_1 = SELECT t.prodcode 'Product Code', t.prodname 'Product Name', ROUND(avg(t.salesvolume),2) 'PastSales Quantity', ROUND(avg(tt.salesvolume),2) 'Sales Quantity',

Re: INNER JOIN across multiple tables appear very slow.

2005-01-23 Thread sam wun
Hi Michael, Thank you for being so kind to explain the problem to me. Michael Stassen wrote: sam wun wrote: sam wun wrote: Hi, Can anyone tell me how to optimize the following sql statement? $sql_1 = SELECT t.prodcode 'Product Code', t.prodname 'Product Name',

INNER JOIN across multiple tables appear very slow.

2005-01-22 Thread sam wun
Hi, Can anyone tell me how to optimize the following sql statement? $sql_1 = SELECT t.prodcode 'Product Code', t.prodname 'Product Name', ROUND(avg(t.salesvolume),2) 'PastSales Quantity', ROUND(avg(tt.salesvolume),2) 'Sales

Re: INNER JOIN across multiple tables appear very slow.

2005-01-22 Thread sam wun
sam wun wrote: Hi, Can anyone tell me how to optimize the following sql statement? $sql_1 = SELECT t.prodcode 'Product Code', t.prodname 'Product Name', ROUND(avg(t.salesvolume),2) 'PastSales Quantity',

Re: Complex joining - multiple tables to one

2005-01-04 Thread SGreen
It's probably your JOIN on shipped items producing a cross product with your JOIN on ordered items. What happens if you take the entire shippeditems JOIN out of your statement? Are your numbers still off? Since your query is not using data from that table you should be able to eliminate it

Complex joining - multiple tables to one

2005-01-03 Thread Ville Mattila
Hi there! I have some problems with the complex MySQL join operations. In most cases, LEFT JOIN fulfills my needs but sometimes it doesn't work in the expected way. I'll give an example: orders -- - orderid - customerid customers - - id - customername orderitems -- - itemid

Re: Performance impact -- multiple databases Vs multiple tables...

2004-12-01 Thread Brent Baisley
(or partition, directory, etc.) each file will be stored on, sort of creating a RAID setup. You would still have one table, but it would be stored in separate files and InnoDB would fill them up sequentially. That can give you the same effect of creating multiple tables, but without the need

Performance impact -- multiple databases Vs multiple tables...

2004-11-30 Thread Alok Gore
Hi All, I tried digging for this information in the archives but could not find anything. I am in to developing an app. that uses very high amount of data (Close to 80 GB per machine). It has 3-4 logical tables. But I have to partition them in to multiple tables because the mysql table size

  1   2   3   >