I have 2 tables with data as.
Table A
FName LName Value
John Brown
Chris Smith
P DeSouza
P DeSilva
Table B
FullName
John Brown
Chris Smith
P De Souza
P De Silva
I am trying to write a query which will update Value column in Table A to 1
if FName and Last Name of a person exists as full Name in Table B. Also
something which takes care of the spaces as shown in last 2 rows. Any help
will be greatly appreciated.
Message posted via http://www.webservertalk.comUPDATE TableA SET Value =1
WHERE EXISTS (SELECT * FROM TableB WHERE TableB.FullName=TableA.Fname+LName)
"ishaan99 via webservertalk.com" <forum@.nospam.webservertalk.com> wrote in message
news:6bc1b1fdf64c49ebb2efcb911fe68fe3@.SQ
webservertalk.com...
> I have 2 tables with data as.
> Table A
> FName LName Value
> John Brown
> Chris Smith
> P DeSouza
> P DeSilva
> Table B
> FullName
> John Brown
> Chris Smith
> P De Souza
> P De Silva
>
> I am trying to write a query which will update Value column in Table A to
1
> if FName and Last Name of a person exists as full Name in Table B. Also
> something which takes care of the spaces as shown in last 2 rows. Any help
> will be greatly appreciated.
> --
> Message posted via http://www.webservertalk.com
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment