•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 375,195 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,137 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 1374 | Replies: 2 | Solved
![]() |
•
•
Join Date: Apr 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Suppose a table ABC have column XYZ containing data
3PSY0001-06-08-F
3PSY0001A-07-09-P
3PSY0001-02-09-P
3PSY0001-07-07-F
3PSY0002-09-08-P
3PSY0002A-01-03-P
3PSY0002-07-07-F
How can i write a query so that the data ending with P without A can be updated with A.
For example, with that query, data
3PSY0001-02-09-P AND 3PSY0002-09-08-P will be updated as
3PSY0001A-02-09-P AND 3PSY0002A-09-08-P while the other data remains the same.
Please Help.
Warm Regards
3PSY0001-06-08-F
3PSY0001A-07-09-P
3PSY0001-02-09-P
3PSY0001-07-07-F
3PSY0002-09-08-P
3PSY0002A-01-03-P
3PSY0002-07-07-F
How can i write a query so that the data ending with P without A can be updated with A.
For example, with that query, data
3PSY0001-02-09-P AND 3PSY0002-09-08-P will be updated as
3PSY0001A-02-09-P AND 3PSY0002A-09-08-P while the other data remains the same.
Please Help.
Warm Regards
•
•
Join Date: Feb 2008
Posts: 14
Reputation:
Rep Power: 1
Solved Threads: 4
update ABC set XYZ = left(XYZ, 8) + 'A' + substring(XYZ, 9, 1000) where XYZ like '%P' and XYZ not like '%A%'
Last edited by huangzhi : Apr 23rd, 2008 at 9:33 am.
Hence Wijaya
www.ex-Soft.tk
www.ex-Soft.tk
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
- Please help with JSP mysql update query (JSP)
- Need update query--Remove the coma "," (PHP)
- passing variables threw query (MySQL)
- Error while trying the update query (ASP)
- ADO.Net SQL UPDATE using OleDBAdapter (C#)
Other Threads in the MS SQL Forum
- Previous Thread: insert data between SQL servers
- Next Thread: Osql issue


Linear Mode