![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Liv Benson to You, Bitch
Industry Role:
Join Date: Aug 2007
Location: Maryland and WV
Posts: 6,060
|
SQL experts, can you please help.
Ok, so I have primary key thats AUTO_INCREMENT. There's another field file_name that I need to populate with number from primary key plus file extension
So right now its like this and I need to run an update query to populate file_name fields File_Id File_name 1 NULL 2 NULL 3 NULL To be File_Id File_name 1 1.jpg 2 2.jpg 3 3.jpg What's correct structure of update query? Thank you ![]()
__________________
![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
UPDATE table SET File_name = CONCAT( File_id, '.jpg' );
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Liv Benson to You, Bitch
Industry Role:
Join Date: Aug 2007
Location: Maryland and WV
Posts: 6,060
|
Huh, it worked. Im so stupid adding convert(varchar(100) to this thinking numeric field cant be concatenated in text fields.
Thank you very much!
__________________
![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |