Rename/Create Database from Existing Database

2003-06-13 Thread Wong Zach-CHZ013
Hi
1- Is there a command to rename an existing database ?
2- If not, how does one create a new database from an existing database ?
could you show me the steps?

Any help is appreciated.
Thanks

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



DATE - longtext

2003-06-12 Thread Wong Zach-CHZ013
Hi
I have a database whose table has a column, which has a datatype longtext.
I then try a query

mysql select MY_DATE from my_table where MLC_DATE between '09/22/2003' AND
'10/21/2
003';

I thought it would fail since the datatype isnt DATE nor TIMESTAMP.
But from the result, it seems to work.

1) Is this query reliable ?
2) What possible scenarios where comparing the string dates would go wrong ?
3) Is there a way to convert all the strings in a database table 
eg
09/22/2003 in each row in the database 
to 
2003-09-22 in each row in the database

Any help is fully appreciated.


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



DATE

2003-06-12 Thread Wong Zach-CHZ013
Hi
1 - I have a column whose datatype is longtext. Its content is 08/06/2003;
I created a new column whose datatype is DATE. Its content is null now.
How do write a SQL statement that
inputs each row from 08/06/2003 in the
old column to 2003-08-06 in a new column ?

Eg:
old column name - my_date
new column name - my_new_date

I tried
 select CONCAT(SUBSTRING(MY_DATE FROM 7),
'-',SUBSTRING_INDEX(MY_DATE,'/',1), '-', MID(MY_DATE,4,2)) from dap_cell;

But how do I put this value into its corresponding row in the new column ?

Any help is appreciated.

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



DATE

2003-06-12 Thread Wong Zach-CHZ013
Hi
How do I rename a new column ?
How do I drop a column ?

From MySQL documentation, it refers
to rename/drop table.
I dont want to do that.

Thanks Paul for your aid.

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



Help - Convert Date from longtext to MySQL date format

2003-01-28 Thread Wong Zach-CHZ013
Hi
I have a few tables in a database Z, namely
table
a
b
c

In table a, the columns are
my_date - longtext
num - int(11)

eg:
mysql select * from a;
+--+--+--+
| my_date   | x|
+--+--+
| 08/06/2002   |1 |
| 08/07/2002   |2 |
+--+--+--+
2 rows in set (0.00 sec)

Tables b and c have the same table structure and data type format.

Q:
How do I convert 08/06/2002 to 2002-08-06 format
without having to reinput all my data from scratch ?

Any help is FULLY appreciated.
Thanks 


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Duplicate Record

2002-05-22 Thread Wong Zach-CHZ013

Hi
1) Suppose, in a file, say testfile.sql, 
it contains a line
eg:
LOAD DATA INFILE mlc_stat_ INTO table mlc FIELDS TERMINATED BY '|' ;
And further suppose the record in file mlc_stat_ already exists in the
table mlc.

Does MySQL have the ability to stop inserting this duplicated record 
when I ran a command

mysql -u root -penter  testfile.sql ?

Thank you

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Duplicate Record

2002-05-22 Thread Wong Zach-CHZ013

Hi
1) Suppose, in a file, say testfile.sql, 
it contains a line
eg:
LOAD DATA INFILE mlc_stat_ INTO table mlc FIELDS TERMINATED BY '|' ;
And further suppose the record in file mlc_stat_ already exists in the
table mlc.

Does MySQL have the ability to stop inserting this duplicated record 
when I ran a command

mysql -u root -penter  testfile.sql ?

Thank you

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Duplicate Record

2002-05-22 Thread Wong Zach-CHZ013



  -Original Message-
 From: Wong Zach-CHZ013  
 Sent: Wednesday, May 22, 2002 7:11 PM
 To:   [EMAIL PROTECTED]
 Subject:  Duplicate Record
 
 Hi
 1) Suppose, in a file, say testfile.sql, 
 it contains a line
 eg:
 LOAD DATA INFILE mlc_stat_ INTO table mlc FIELDS TERMINATED BY '|' ;
 And further suppose the record in file mlc_stat_ already exists in the
 table mlc.
 
 Does MySQL have the ability to stop inserting this duplicated record 
 when I ran a command
 
 mysql -u root -penter  testfile.sql ?
 
 Thank you

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php