3 tables:
table1 - table2 (one to many)
table2 - table3 (one to one) [designed like this]
how to achieve this?
select table1.*, table2.*, table3.*, sum(table2.field3), sum(table2.field4)
from table1, table2, table3 where table1.field1 = table2.field1 and
table2.field1 = table3.field1
regards
On 2/20/06, Eric Persson [EMAIL PROTECTED] wrote:
Hi,
I have a query which works fine for me in my 4.1 environment, but when
moved to the 5.0.18 environment, it fails with the result below:
mysql SELECT r.uid, u.username, u.image_type, count(id) AS antal,
s.timestamp FROM recruits_uid r,
Hi
Does anybody know where i can get a load of sample questiosn for the
MySQL certificate exams, i know there are a few on mysql's site but i
was hoping to find quite a few to practice on.
Thanks
Ade
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To
Daniel,
What about just running your import file through dos2unix before piping
it to mysql?
That way, it would leave \n alone (since that is unix format) and
replace any occurrances of
\r\n with plan old \n.
--
George
-Original Message-
From: Daniel Kasak [mailto:[EMAIL
Jan Pieter Kunst [EMAIL PROTECTED] wrote on 02/21/2006 04:54:46 AM:
On 2/20/06, Eric Persson [EMAIL PROTECTED] wrote:
Hi,
I have a query which works fine for me in my 4.1 environment, but when
moved to the 5.0.18 environment, it fails with the result below:
mysql SELECT r.uid,
Easier than that (though Sheeri's way would work):
ALTER TABLE yourtablename DISABLE KEYS;
SET FOREIGN_KEY_CHECKS=0;
... do your processing ...
SET FOREIGN_KEY_CHECKS=1;
ALTER TABLE yourtablename ENABLE KEYS;
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html
Michael,
I have been following this thread from the beginning and I just don't see
the practical difference between what you propose and the replication
methods (SBR and RBR) already in place. How does what you propose differ
from the SBR (statement -based replication) that MySQL already
Once CHECK CONSTRAINTS are enabled, I am sure there will be a way to turn
them off temporarily. Right now, you can create tables that have them but
they are not enforced. To quote
http://dev.mysql.com/doc/refman/5.0/en/create-table.html
InnoDB tables support checking of foreign key
how to achieve this?
select table1.*, table2.*, table3.*, sum(table2.field3), sum(table2.field4)
from table1, table2, table3 where table1.field1 = table2.field1 and
table2.field1 = table3.field1
Your question as formulated has no answer. If you query aggregate
values like Sum on a table, you
Shawn,
Thanks for the reply, but I think the thread has become much more dramatic than
nececessary. Basically, I'm not looking for what has been ALTERed. I simply
need the table
creation data output in ALTER IGNORE (or whatever is appropriate) format so as
to ensure
table structure is the
Hello,
I am having a table with an integer column which I use for probability
calculations (the higher a value the more often it is chosen).
Now I am having the following query, which should actually incorporate
these probabilities, however it seems to prefer values from the middle
range
One problem with dual-master or multi-master replication is that you have
to be able to set and check a lock across all masters before performing a
schema change. How would you deal with this scenario using your ALTER
TABLE database dumps without such a lock?
Server A and B share a table X
Ah, well, in this particular DB, *every single transaction* it's it's own
entry. . .basically the DB itself is a binary log. . .kinda. . .sorta. So the
current value of a particular item isn't necessarily an issue since, once
entered, it will always be the same. A change to that value will in
Hi, list!
I'm facing some porblems with mysqldump.
Here is it:
[EMAIL PROTECTED] ~] mysqldump --help | grep -- -Q
-Q, --quote-names Quote table and column names with `
[EMAIL PROTECTED] ~] mysqldump -Q -u -p -h dbname dump.sql
mysqldump: invalid option -- Q
Am I doing
At 21:22 +0300 2/21/06, [EMAIL PROTECTED] wrote:
Hi, list!
I'm facing some porblems with mysqldump.
Here is it:
[EMAIL PROTECTED] ~] mysqldump --help | grep -- -Q
-Q, --quote-names Quote table and column names with `
[EMAIL PROTECTED] ~] mysqldump -Q -u -p -h dbname
Ok, I get that. I have several tables just like that (I use mine as shadow
tables for change audits. Every change to the normal table ends up
creating new record in the shadow table thus documenting each state of
the normal table through time). However, shouldn't schema changes be very
rare
Yes, schema changes would/should be rare. You may be right, but I would think
that since schema information is *alway* checked before any INSERTS then we
should be good. There should never be an occasion to break per se.
Obviously anything can happen, and appropriate recovery methods (e.g.
Why, when I create a table as follows:
mysql create table requestid ( request_id int not null default
1, constraint requestid_innodb_pk_cons primary key(request_id) )
ENGINE=InnoDB;
Query OK, 0 rows affected (0.02 sec)
Do I get the following?
mysql select request_id from requestid;
Neroux,
RAND() gives a roughly rectangular distribution, not a normal
distribution, so samples of fewer than 100 or so values from it are
likely to show large but statistically _insignificant_ differences. In
larger samples, I don't see any tendency of RAND() to produce more
values near its
On Tue, 21 Feb 2006, Patrick Duda wrote:
Why, when I create a table as follows:
mysql create table requestid ( request_id int not null default 1,
constraint requestid_innodb_pk_cons primary key(request_id) ) ENGINE=InnoDB;
Query OK, 0 rows affected (0.02 sec)
Defines the properties of
Patrick Duda [EMAIL PROTECTED] wrote on 02/21/2006 02:39:47 PM:
Why, when I create a table as follows:
mysql create table requestid ( request_id int not null default
1, constraint requestid_innodb_pk_cons primary key(request_id) )
ENGINE=InnoDB;
Query OK, 0 rows affected (0.02
This must have been asked before but I could not find the answer searching
the list archives.
I have a simple table:
CREATE TABLE `license` (
`id` int(11) NOT NULL auto_increment,
`firstname` varchar(100) NOT NULL default '',
`lastname` varchar(100) NOT NULL default '',
`host_address`
Patrick,
Shouldn't I be getting back a '1' when I do my select???
Why am I getting an empty set?
First, creating a table doesn't add any rows. Show Create Table ...
returns a row of data definition info, not a row of table data.
Second, Defining the column as NOT NULL will require numeric
Guillaume Boissiere wrote:
This must have been asked before but I could not find the answer searching
the list archives.
I have a simple table:
CREATE TABLE `license` (
`id` int(11) NOT NULL auto_increment,
`firstname` varchar(100) NOT NULL default '',
`lastname` varchar(100) NOT NULL
Guillaume Boissiere [EMAIL PROTECTED] wrote on 02/21/2006 02:23:29
PM:
This must have been asked before but I could not find the answer
searching
the list archives.
I have a simple table:
CREATE TABLE `license` (
`id` int(11) NOT NULL auto_increment,
`firstname` varchar(100) NOT NULL
I'm assuming you're doing this as root (hence the # sign).
The way to debug this, as with any script, is to run it manually on
the command line and see what errors you get. So if you run the
following, what happens?
mysqldump --opt -c -C dp /var/tmp_save/dproject.sql
(not sure if you ran that
Hello,
I commonly create webpages that need to search through a MySQL
database and then display the results to the user. An example would
be a database that contains the following:
first name
last name
age
gender
location
job
interests
I usually create a webpage with a combination of drop
George Law wrote:
Daniel,
What about just running your import file through dos2unix before piping
it to mysql?
That way, it would leave \n alone (since that is unix format) and
replace any occurrances of
\r\n with plan old \n.
I could think of a lot of things I could do if this were all
A little less dodgy is to write a VBA routine within Access to do the
filtering. Alternatively, if you don't want to trust access to do it, you
can write a VBScript or JScript routine and run it through the shell (yes,
Windoze has shell scripts, too)
There are all kinds of things you can do.
- Original Message -
From: Douglas S. Davis [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Tuesday, February 21, 2006 3:58 PM
Subject: Creating a Web Database Search Application
Hello,
I commonly create webpages that need to search through a MySQL
database and then display the
- Original Message -
From: Douglas S. Davis [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Tuesday, February 21, 2006 3:58 PM
Subject: Creating a Web Database Search Application
Hello,
I commonly create webpages that need to search through a MySQL
database and then display the
Hello Peter,
thanks for your reply, however my question was less related to RAND()
but more about the weird situation that the results are more or less
fine with the two queries, however different when they are combined
into one query with a subquery.
Thanks
--- Peter Brawley [EMAIL PROTECTED]
Is there such a thing in mySQL ?
I could not find anything anywhere.
thanks,
laszlo
Hi.
I have a database that is fairly large and I'm doing some testing with 2
different mysql packages, one 32-bit, one 64bit, for comparison's sake.
Now I've finished with one of the dbs and I want to reclaim the disk space.
I've tried deleting a few (large) tables from the database,
the study guide?
Adrian Bruce wrote:
Hi
Does anybody know where i can get a load of sample questiosn for the
MySQL certificate exams, i know there are a few on mysql's site but i
was hoping to find quite a few to practice on.
Thanks
Ade
--
life is a game... so have fun.
--
MySQL
I've been searching the web for the past few hours trying to find a simple
drop-in class or functions to implement Nested Set Model or modified
preorder tree traversal.
I've found several tutorials and related links:
http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
Hi,
With so few fields, sticking with one report isn't
out of the question. Don't know if you're using
this technique:
my $lname = $q-param('lname') || '%';
So all fields not filled/selected by the user are
wildcards by default. A completely empty form
pulls all data in the relevant tables.
Thanks Sheeri:
Yes, you where right. It was because I was not opening the table first.
Actually, I was using this statements from a MySQL GUI (MySQL Query
Browser) so it doesn't work in this program (it doesn't keeps the table
opened).
But when I use your example in the shell mode it works
Got myself a little stumped here, 4.0.18-standard
Three tables in this mess, orders, order_items and products.
orders.prod_id = order_items.prod_id = products.prod_id is how I relate them
all to each other.
order_items has a quantity field.
I need a report that shows me all the products with
39 matches
Mail list logo