Need some urgent help in using UPDATE command in SQL

This is a discussion on Need some urgent help in using UPDATE command in SQL within the MySQL Database forums, part of the Database Forums category; I have two tables: Table Name: table1 Table Rows: a b Table Name: table2 Table Rows: a b c d ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-20-2007
Legend
 
Posts: n/a
Default Need some urgent help in using UPDATE command in SQL

I have two tables:

Table Name: table1
Table Rows: a b

Table Name: table2
Table Rows: a b c d e f

Initially c of table2 is empty. I want to actually fill it up from
table1 using some statement like:

UPDATE table2 SET c={SELECT a FROM table1 WHERE b=d}

Where d belongs to table2.

Is this possible?

Reply With Quote
  #2 (permalink)  
Old 10-20-2007
Kees Nuyt
 
Posts: n/a
Default Re: Need some urgent help in using UPDATE command in SQL

On Sat, 20 Oct 2007 05:36:58 -0000, Legend
<rahul986@gmail.com> wrote:

>I have two tables:
>
>Table Name: table1
>Table Rows: a b
>
>Table Name: table2
>Table Rows: a b c d e f
>
>Initially c of table2 is empty. I want to actually fill it up from
>table1 using some statement like:
>
>UPDATE table2 SET c={SELECT a FROM table1 WHERE b=d}
>
>Where d belongs to table2.
>
>Is this possible?


Just try it and you will know.
I think the braces should be parenthesis.
--
( Kees
)
c[_] Famous last words - Don't worry, I can handle it. (#441)
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0