Click here to Skip to main content
15,898,035 members
Home / Discussions / Database
   

Database

 
QuestionScript Check Pin
Mustafa Ismail Mustafa2-Sep-09 9:46
Mustafa Ismail Mustafa2-Sep-09 9:46 
AnswerRe: Script Check Pin
Mycroft Holmes2-Sep-09 18:06
professionalMycroft Holmes2-Sep-09 18:06 
GeneralRe: Script Check Pin
Mustafa Ismail Mustafa2-Sep-09 20:47
Mustafa Ismail Mustafa2-Sep-09 20:47 
Questionupdate issue Pin
Tauseef A2-Sep-09 2:30
Tauseef A2-Sep-09 2:30 
AnswerRe: update issue Pin
Blue_Boy2-Sep-09 2:38
Blue_Boy2-Sep-09 2:38 
AnswerRe: update issue Pin
David Mujica2-Sep-09 3:32
David Mujica2-Sep-09 3:32 
AnswerRe: update issue Pin
Abhishek Sur2-Sep-09 9:43
professionalAbhishek Sur2-Sep-09 9:43 
AnswerRe: update issue Pin
Niladri_Biswas2-Sep-09 17:18
Niladri_Biswas2-Sep-09 17:18 
Hi, I really cannot understand your requirement.

What you are trying to achieve, is not at all clear in the statement presented here.

I fully agree with Abhishek.

However, if you invoke the statement "update tale1 set substring(orderno,6,2) = 'tt'" you will get the following error

"Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ','."


Now, I have a table say tblOrder with the following records.

OrderNo
------------
123456789
234567891
345678912
45678123
67
78
89


My goal is to update those orderno's that will satisfy the condition substring(orderno,6,2).

Means, if the order no is 987623456 , then substring('987623456',6,2) will yield me 34. So if any OrderNo 34 is present, that will be updated.

The query is

update tblOrder set  OrderNo =  'tt'

where OrderNo in( select substring(OrderNo,6,2) from tblOrder)


The output is

OrderNo
------------
123456789
234567891
345678912
45678123
tt
tt
tt


Hope this helps
Smile | :)

Niladri Biswas

Questione-blood bank Pin
noo.dyab2-Sep-09 1:07
noo.dyab2-Sep-09 1:07 
AnswerRe: e-blood bank Pin
Ashfield2-Sep-09 1:28
Ashfield2-Sep-09 1:28 
GeneralRe: e-blood bank Pin
Garth J Lancaster2-Sep-09 1:41
professionalGarth J Lancaster2-Sep-09 1:41 
AnswerRe: e-blood bank [modified] Pin
annathor2-Sep-09 1:42
annathor2-Sep-09 1:42 
GeneralRe: e-blood bank Pin
samawat8-Dec-09 4:49
samawat8-Dec-09 4:49 
GeneralRe: e-blood bank Pin
samawat8-Dec-09 4:51
samawat8-Dec-09 4:51 
AnswerRe: e-blood bank Pin
AlexeiXX33-Sep-09 9:47
AlexeiXX33-Sep-09 9:47 
QuestionExporting a database Pin
MarkB7771-Sep-09 23:09
MarkB7771-Sep-09 23:09 
AnswerRe: Exporting a database Pin
SeMartens2-Sep-09 0:14
SeMartens2-Sep-09 0:14 
AnswerRe: Exporting a database Pin
Jerry Hammond2-Sep-09 2:34
Jerry Hammond2-Sep-09 2:34 
AnswerRe: Exporting a database Pin
Abhishek Sur2-Sep-09 9:53
professionalAbhishek Sur2-Sep-09 9:53 
AnswerRe: Exporting a database Pin
εїзεїзεїз2-Sep-09 11:43
εїзεїзεїз2-Sep-09 11:43 
GeneralRe: Exporting a database Pin
Abhishek Sur2-Sep-09 11:59
professionalAbhishek Sur2-Sep-09 11:59 
GeneralRe: Exporting a database Pin
εїзεїзεїз2-Sep-09 13:42
εїзεїзεїз2-Sep-09 13:42 
QuestionWhat is SQL Query:Master child table [modified] Pin
xodeblack1-Sep-09 20:24
xodeblack1-Sep-09 20:24 
AnswerRe: What is SQL Query:Master child table Pin
Mycroft Holmes1-Sep-09 21:14
professionalMycroft Holmes1-Sep-09 21:14 
GeneralRe: What is SQL Query:Master child table Pin
xodeblack1-Sep-09 22:39
xodeblack1-Sep-09 22:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.