Re: MySQL 4 query assistance
if you just want to change the name of the resulting column for the current query only (the change will not be permanent)
Code:
SELECT master as Susan from product
if you want to change the name of the column permanently you'll need to alter the table:
Code:
alter table product change master suzan same_column_definition_for_master
you can know the same_column_definition_for_masterusing this query:
Code:
show create table product
you can send the result of the above query (show create...) so I can write the complete alter query for you.
you can (and better) use a tool like phpmyadmin (web based) or MySQL Administrator which is free and good
Re: MySQL 4 query assistance
Okay. Let me see if I can do this for you.
The table name is _products, the column is provider, and each cell in that column is named master. I want to change master to Susan.
Here is the results of the SELECT query you had me perform in phpadmin:
SELECT provider AS Susan
FROM `_products`
WHERE 1
LIMIT 0 , 30
Re: MySQL 4 query assistance
Ok
the situation looks clearer
you want to updated the (values) of the column provider in the _products table from 'master' to 'suzan'
at first : take a backup of the table (easy using phpmyadmin)
then run this query:
Code:
update _products Set provider = 'suzan' where provider = 'master'
now all records with provider = master will change to suzan.
tell me if it works fine or if you find any problems, don't forget to take a backup before running queries that change a lot of records.
Re: MySQL 4 query assistance
The query worked perfectly. Thank you very much!!!