Adsense
Popular Posts
- Code update from PHP 7.4 to PHP 8.1 - PhpSpreadsheet
- MySQL workbench -"Could not decrypt password cache"
- Code update from PHP 7.4 to PHP 8.1 - Worksheet/Iterator.php
- Rendering HTML tags inside textarea
- axios handle blob type data
- Unix Utils and wget in Windows
- increase mysql query speed
- Setup vi syntax for PHP
- Get WAMP running on EC2
- EXCEL return to the next line in the same cell
Monday, July 14, 2014
Get first 4 strings of the field in MySQL
I have a MySQL table fmcontract_sims_courses, and I only want to select the first 4 strings of the field
CourseDescription_original:
SELECT SUBSTRING(CourseDescription_original, 1, 4) FROM fmcontract_sims_courses
Copy this value to the column Section in table fmcontract_course_assignment:
UPDATE fmcontract_course_assignment as a, fmcontract_sims_courses as b SET a.Section =
SUBSTRING(b.CourseDescription_original, 1, 4) WHERE a.CRSEID = b.CourseKey
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment