dbase calculations

2003-07-28 Thread Kalle Saarinen
Hello

I'm rather new when it comes to databases and I was hoping that someone
could help me out! I  was just wondering is it possible to make a field in
MySQL dbase wich is a total of two other fields.

ie.

field_XX is a sum of field_1 and field2

Thanks

-Kalle


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: dbase calculations

2003-07-28 Thread Kalle Saarinen
Thanks

- Original Message - 
From: Adam Nelson [EMAIL PROTECTED]
To: 'Andy Jackman' [EMAIL PROTECTED]; 'MySQL'
[EMAIL PROTECTED]
Sent: Tuesday, July 29, 2003 12:26 AM
Subject: RE: dbase calculations


 I believe views in Oracle (SQL Server? Sybase?) can do this if you need
 it.

  -Original Message-
  From: Andy Jackman [mailto:[EMAIL PROTECTED]
  Sent: Monday, July 28, 2003 12:36 PM
  To: MySQL
  Subject: Re: dbase calculations
 
 
  Kalle,
  The usual way to do this is to create the table with the 2 real fields
  and then use a query to 'create' the sum field at run time.
  For example
  assume you have this table:
 
  create table my_table (
  field_1 int(9),
  field_2 int(9)
  );
 
  then you can write this query:
  SELECT field_1, field_2, (field_1 + field_2) AS my_sum FROM my_table;
 
  This print 3 'fields', the third one is called my_sum and contains the
  sum of the other two (the AS keyword gives a field a name).
 
  Hope this helps,
  Andy.
 
 
 
 
  Kalle Saarinen wrote:
  
   Hello
  
   I'm rather new when it comes to databases and I was hoping
  that someone
   could help me out! I  was just wondering is it possible to
  make a field in
   MySQL dbase wich is a total of two other fields.
  
   ie.
  
   field_XX is a sum of field_1 and field2
  
   Thanks
  
   -Kalle
  
   --
   MySQL General Mailing List
   For list archives: http://lists.mysql.com/mysql
   To unsubscribe:
  http://lists.mysql.com/mysql? [EMAIL PROTECTED]
 


 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



mysqldump

2003-07-07 Thread Kalle Saarinen
Hello

I'm trying to make mysqldump in a shell script but I can't deliver password
to sql server.

I have command in the script:

mysqldump databasename -u username -p password  /to/a/directory/dump.sql

When i run the script it asks for a password and takes the password given in
the script for a table name.

How can I give the password in the script???

mysqldump --help wasn't wery helpful...

-Kalle

Thanks


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



mysqldump

2003-07-07 Thread Kalle Saarinen
Hello

I'm trying to make mysqldump in a shell script but I can't deliver password
to sql server.

I have command in the script:

mysqldump databasename -u username -p password  /to/a/directory/dump.sql

When i run the script it asks for a password and takes the password given in
the script for a table name.

How can I give the password in the script???

mysqldump --help wasn't wery helpful...

-Kalle

Thanks


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]