Adsense
Popular Posts
- MySQL workbench -"Could not decrypt password cache"
- peer review (3)
- PHP, dump varailbes in a format way
- "Unusual traffic from your computer network" from blogger
- Install APXS in Redhat Linux
- JavaScript, remove trailing insignificant zeros after toFixed function
- Update member directory
- Set Windows path command line
- JavaScript: add days to current date
- DataTable table order by numeric, not by text
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