i got closer but i can't figure out this:
individually:
A) select a.job, sum(b.money) from t1 as a left join t2 as b on
a.account = b.account where a.job = "ca1" and b.money > 0;
+--+---+
| job | sum(b.money) |
+--+-
I'm trying to calculate glycemic index of all food items eaten in a
day with a single SELECT. The problem is the calculation for glycemic
index of each item requires a total of all items' carbs. It's like a
circular reference. Here's what I'm trying:
SELECT
sum(foodi
Thanks, that was exactly what I needed. :-)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
More details.
CREATE TABLE mailer_student_status (
student_id decimal(22,0) NOT NULL default '0',
param varchar(128) NOT NULL default '',
value varchar(128) default NULL,
PRIMARY KEY (student_id,param).
KEY idx_value (value)
)
SELECT VALUE
FROM mailer_student_status
WHERE student_id
hi...
how do i do conditional sums? like:
select a.job, sum(if b.amount > 0 then amount end if ) from t1 as a left
join t2 as b on a.account=b.accoun where a.account = b.account group by
a.job;
or
select a.job, if b.amount > 0 then sum(b.amount) end if from t1 as a
left join t2 as b o
I have an existing data set - here is an example (the real one is more
complex than this)
LOC DATA
-
A 1
B 2
C 3
D 4
E 5
F 6
...
and I am looking to run some sort of INSERT ... SELECT on this to make
a new table like this:
LOC DATA
Hi,
Well at first glance its hard to tell since "param" and "value" don't
say a lot about the nature of the data.
If this is innodb, you can have a PRIMARY KEY of student_id (assuming
its unique) and a separate index on param, this is because of the way
innodb is structure, the primary key is alwa
We'd need more information on what the where clauses of the queries
look like to assist with this.
-Aaron
On 9/5/08, Krishna Chandra Prajapati <[EMAIL PROTECTED]> wrote:
> Hi,
>
> What would you say about the below table . What can i do to make it more
> efficient.
>
> CREATE TABLE mailer_student
Hi Brian,
Try this.
SELECT SUM(mi.calories) FROM Meal_Items as mi, People as P, Meals as
m WHERE p.Person_ID = '5' AND p.Person_ID=m.Person_ID AND m.Date =
'2009-09-04' AND m.Meal_ID = mi.Meal_id GROUP BY p.Person_ID
Hi Gerald: This part is throwing me off " ON People.Name=Meals.Name" .
But I
Hi,
What would you say about the below table . What can i do to make it more
efficient.
CREATE TABLE mailer_student_status (
student_id decimal(22,0) NOT NULL default '0',
param varchar(128) NOT NULL default '',
value varchar(128) default NULL,
PRIMARY KEY (student_id,param).
KEY idx_va
Brian Dunning wrote:
How do I query "How many calories did Brian eat on 2009-09-04"?
Table:People
+---+---+
+ Person_ID + Name |
+---+---+
| 5 | Brian |
+---+---+
Table:Meals
+-+---+---++
| Meal_ID | Person_ID | Me
How do I query "How many calories did Brian eat on 2009-09-04"?
Table:People
+---+---+
+ Person_ID + Name |
+---+---+
| 5 | Brian |
+---+---+
Table:Meals
+-+---+---++
| Meal_ID | Person_ID | Meal_Name | Date |
Hi,
Following on from what Mike mentioned, indexing all columns does not
really help as MySQL will at most use one index for a query, so its
important to pick your indexes carefully and consider constructing
composite indexes. An index on a single column may not even be used
due to poor cardinalit
As your table grows your inserts will start to get slower and slower. You
run into the issue of locking a table due to re-creating the indexes. Also
wasted space for indexes
On 9/5/08, Krishna Chandra Prajapati <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I am looking for, is there any specific re
Hi all,
I am looking for, is there any specific reason for not indexing all columns
of a table. whats the impact on the performance. Although indexing is meant
for getting great performance. So, why indexing all columns is not
feasible. (Read in docs that all columns should not be indexed)
--
Shaun Adams schrieb:
> When I perform a dump in mysql5 to mysql 4 DB, I get the error (below).
> Does anyone know how I can resolve this?
>
>
>
> QUERY (windows server from the cmd prompt)
>
> mysqldump --lock-tables --user=root [SOURCE DB] | mysql --user=[USERNAME]
> --password=[PASSWORD] --
On Fri, Sep 5, 2008 at 12:55 PM, Josh Miller <[EMAIL PROTECTED]> wrote:
> Aaron Blew wrote:
>>
>> Here are a couple ideas:
>> * Decrease innodb_autoextend_increment to 8 or even 4. You may see
>> additional IO wait because you're pre-allocating space in chunks
>> disproportinate to what you immedi
Aaron Blew wrote:
Here are a couple ideas:
* Decrease innodb_autoextend_increment to 8 or even 4. You may see
additional IO wait because you're pre-allocating space in chunks
disproportinate to what you immediately need, causing bursty performance.
* If your remaining MyISAM tables don't need it
When I perform a dump in mysql5 to mysql 4 DB, I get the error (below).
Does anyone know how I can resolve this?
QUERY (windows server from the cmd prompt)
mysqldump --lock-tables --user=root [SOURCE DB] | mysql --user=[USERNAME]
--password=[PASSWORD] --host=[HOST] [TARGET DB]
ERROR MESS
From: Roland Kaber [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2008 11:24 PM
To: Jerry Schwartz
Cc: mysql@lists.mysql.com
Subject: Re: Erro 1406 Data too long
It looks like it is really a character set conflict. The copyright character ©
is ascii 169 and is part of latin-1. Howeve
I currently have a MySQL server in production and am considering protecting
it with DRBD. The kicker is that it is a production database and so I can't
take it offline, or can take it offline for only a very (several minutes
max) short period of time. Is it feasible to get this working without
much
21 matches
Mail list logo