Properly ALTER Column Data?

Properly ALTER Column Data?

am 11.03.2010 21:43:47 von Carlos Williams

I know this is very basic for most on the list but I need some MySQL
help. I am logged into my database and I successfully changed a 'field
type' from INT to VARCHAR. Now I need to modify the actual data I
inserted into those specific fields. I checked the manual and could
not really gather exactly how to format my command. There was just so
many options and information on the page...

My table data is as follows and I would like to 'ALTER' the data in
all three 'Serial' fields:

mysql> select Model, Serial, GFE, EOL from sun;
+----------+--------+------+------------+
| Model | Serial | GFE | EOL |
+----------+--------+------+------------+
| Ultra 24 | 941 | 8402 | 2010-10-16 |
| 7310 | 934 | 9314 | 2012-08-27 |
| J4400 | 926 | 7623 | 2012-08-27 |
+----------+--------+------+------------+
3 rows in set (0.00 sec)

Can someone please help me understand how I am to properly use and
change the data in MySQL?

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

RE: Properly ALTER Column Data?

am 11.03.2010 21:57:32 von Gavin Towey

UGxlYXNlIHJlYWQgdGhlIHR1dG9yaWFsLCBsZXQgdXMga25vdyBpZiB5b3Ug aGF2ZSBxdWVzdGlv
bnMgb24gdGhlIGluZm9ybWF0aW9uIGluIGl0Og0KaHR0cDovL2Rldi5teXNx bC5jb20vZG9jL3Jl
Zm1hbi81LjAvZW4vdHV0b3JpYWwuaHRtbA0KDQoNCg0KLS0tLS1PcmlnaW5h bCBNZXNzYWdlLS0t
LS0NCkZyb206IENhcmxvcyBNZW5uZW5zIFttYWlsdG86Y2FybG9zd2lsbEBn bWFpbC5jb21dDQpT
ZW50OiBUaHVyc2RheSwgTWFyY2ggMTEsIDIwMTAgMTI6NDQgUE0NClRvOiBN eVNRTA0KU3ViamVj
dDogUHJvcGVybHkgQUxURVIgQ29sdW1uIERhdGE/DQoNCkkga25vdyB0aGlz IGlzIHZlcnkgYmFz
aWMgZm9yIG1vc3Qgb24gdGhlIGxpc3QgYnV0IEkgbmVlZCBzb21lIE15U1FM DQpo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veWVkLCBhcnJpdmUgbGF0ZSBvciBp bmNvbXBsZXRlLCBv
ciBjb250YWluIHZpcnVzZXMuIFRoZSBzZW5kZXIgdGhlcmVmb3JlIGRvZXMg bm90IGFjY2VwdCBs
aWFiaWxpdHkgZm9yIGFueSBsb3NzIG9yIGRhbWFnZSBjYXVzZWQgYnkgdmly dXNlcyBvciBlcnJv
cnMgb3Igb21pc3Npb25zIGluIHRoZSBjb250ZW50cyBvZiB0aGlzIG1lc3Nh Z2UsIHdoaWNoIGFy
aXNlIGFzIGEgcmVzdWx0IG9mIGUtbWFpbCB0cmFuc21pc3Npb24uIFtGcmll bmRGaW5kZXIgTmV0
d29ya3MsIEluYy4sIDIyMCBIdW1ib2x0IGNvdXJ0LCBTdW5ueXZhbGUsIENB IDk0MDg5LCBVU0Es
IEZyaWVuZEZpbmRlci5jb20NCg==

Re: Properly ALTER Column Data?

am 11.03.2010 22:17:21 von Carlos Williams

On Thu, Mar 11, 2010 at 3:57 PM, Gavin Towey wrote:
> Please read the tutorial, let us know if you have questions on the information in it:
> http://dev.mysql.com/doc/refman/5.0/en/tutorial.html

Thank you very much for the link...

I did:

UPDATE sun SET serial = '0123456789' WHERE Model = 'Ultra 24';

Worked fine!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org