On May 30, 2005, at 1:28 AM, [EMAIL PROTECTED] wrote:
you can just play :
set @total:=0;
select name,price,quantity, price*quantity as
subtotal,@total:[EMAIL PROTECTED]
from fruits;
select @total as "grand total";
works great. thanks very, very much.
- philip
--
MySQL General
On May 29, 2005, at 2:34 PM, [EMAIL PROTECTED] wrote:
you can use mysql variables :
set @total:=0;
select name,price,quantity, price*quantity as
subtotal,@total:[EMAIL PROTECTED]
from fruits;
++---+--+--
+---+
| name |
mysql.sock is created by mysqld when it starts, and destroyed when it
stops.
haha. you're absolutely right. that doesn't make any sense. i wasn't
thinking about the nature of socket files when i wrote that.
now that i go back and read the post i was referring to, i think the
poster was ac
On May 29, 2005, at 11:13 AM, [EMAIL PROTECTED] wrote:
I get these:
Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/var/mysql/mysql.sock' (13) in
/Library/WebServer/testpad/test.php on line 3
Warning: mysql_select_db(): Can't connect to local MySQL server
th
:
chown mysql:wheel /tmp/mysql.sock
chmod 4777 /tmp/mysql.sock
- philip
On May 29, 2005, at 12:33 PM, Philip George wrote:
try looking at these two pages:
http://dev.mysql.com/doc/mysql/en/access-denied.html
http://dev.mysql.com/doc/mysql/en/connecting-disconnecting.html
search them
try looking at these two pages:
http://dev.mysql.com/doc/mysql/en/access-denied.html
http://dev.mysql.com/doc/mysql/en/connecting-disconnecting.html
search them both for '2002' (multiple instances on one of the pages).
there a couple suggestions for things to try.
hth.
- philip
--
MySQL Gen
actually, i've decided this is sort of a moot point, since i can do
this calculation in the client app.
no sql required.
thanks.
- philip
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
The join is irrelevant. Your join returns a resultset and you can just
pretent that resultset is a single table:
SELECT field1, field2, field3
FROM (very complicated join) AS simpletable
GROUP BY ...
WITH ROLLUP
Just copy-pate your join into this and fix the fieldnames.
aaahhh
okay, i'm
http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html
already read that. the join in my example is more complicated than
anything depicted on that page.
please explain.
actually i should say that there are no examples of SUM() or AVG() --
or any of the other GROUP BY functions -- th
On May 29, 2005, at 1:41 AM, Jochem van Dieten wrote:
http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html
already read that. the join in my example is more complicated than
anything depicted on that page.
please explain.
- philip
--
MySQL General Mailing List
For list archives:
x27;ve tried with no success to use SUM() to do this.
would i even use SUM()?
if i could refer to the resultant table above in a subsequent select,
that would be ideal. is there a way to do that (something like select
SUM(@@result.subtotal);)?
thanks.
- philip
On May 28, 2005, a
is it okay to post a basic sql join question to this list?
if not, please point me to a list for these types of questions.
thanks.
- philip
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
thanks.
- philip
On May 28, 2005, at 10:08 PM, Paul DuBois wrote:
http://dev.mysql.com/doc/mysql/en/silent-column-changes.html
At 21:29 -0500 5/28/05, Philip George wrote:
when i create a table with:
CREATE TABLE person (
id char(36) NOT NULL PRIMARY KEY,
firstname varchar(50
when i create a table with:
CREATE TABLE person (
id char(36) NOT NULL PRIMARY KEY,
firstname varchar(50) DEFAULT NULL,
lastname varchar(50) DEFAULT NULL
);
...and then use describe to show what i've got:
mysql> describe person;
+---+-+--+-+-+
ahhh...
thanks.
good to know.
- philip
On May 28, 2005, at 8:57 PM, Paul DuBois wrote:
At 20:50 -0500 5/28/05, Philip George wrote:
ya, i just meant when you go to the main table of contents page for
the docs:
http://dev.mysql.com/doc/mysql/en/index.html
... there's no mention
, 2005, at 8:38 PM, Paul DuBois wrote:
At 20:26 -0500 5/28/05, Philip George wrote:
this is what i was looking for:
SHOW CREATE TABLE tablename;
for some reason it isn't on the main doc page.
- philip
http://dev.mysql.com/doc/mysql/en/show-create-table.html
On May 28, 2005, at 8:19 PM
thanks.
- philip
On May 28, 2005, at 8:25 PM, Paul DuBois wrote:
At 20:19 -0500 5/28/05, Philip George wrote:
what's the sql syntax (in mysql) for exporting a table's structure
and and data (the one that reiterates the original CREATE TABLE
statement)?
..so that i'
this is what i was looking for:
SHOW CREATE TABLE tablename;
for some reason it isn't on the main doc page.
- philip
On May 28, 2005, at 8:19 PM, Philip George wrote:
what's the sql syntax (in mysql) for exporting a table's structure and
and data (the one that reiterat
what's the sql syntax (in mysql) for exporting a table's structure and
and data (the one that reiterates the original CREATE TABLE statement)?
..so that i'll end up with something that can be put in a .sql script
for later imports if needed.
thanks.
- philip
--
MySQL General Mailing List
F
i see a lot of variation out there on this subject. some people are
using varchar(64), some varchar(32), and some other non-base2 widths.
what is the proper width? i count 36 characters below, including the
four dashes.
mysql> select uuid();
+--+
| uuid()
20 matches
Mail list logo