473,507 Members | 6,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update Statment - Help wanted

1 New Member
Hi,

I am fairly new to SQL statements and where as i can perform retriving types of queries i have been stuck on an UPDATE one for weeks now; quite frankly its making me pull what little hair i have left out!

I was hoping that someone alot smarter than me would be able to help.

I am trying to update a feild on one table based on 2 critera; one from the same table and another from another table.

This is what i am trying to do in "pigeon" sql languge

Update assignment
set assignent_type = "X" where assignment type ='Y' and request.request_type = 'Z'

If anyone out there can help you will saving valuable hair folicles.

Many thanks

Morris
Oct 3 '06 #1
2 1379
saravanankm
47 New Member
hi moz2407!

Update assignment
set assignent_type = "X" where assignment type ='Y'
and request.request_type = 'Z'

this is Error

try this qry

Update assignment
set assignent_type = "X" where assignment_type ='Y'
and request.request_type = 'Z'


thnaks
Captain
Oct 6 '06 #2
Reshmi Jacob
50 New Member
Hello Morris

From what I understood, I think that ASSIGNMENT & REQUEST are two tables.
In the SQL stmt you must have to link the two table. IF RKey is the link b/w two tables :-

Update assignment
set assignent_type = "X" where assignment_type ='Y'
and ASSIGNMENT.RKey IN (SELECT RKey from REQUEST where request.request_type = 'Z')

If you have two or more fields as key , you can replace RKey with
RKey1|| RKey2||RKey3, same order should be followed in the SELECT stmt.

Hope this will save Five - Six hairs on your head!!!!!!!!!!!!!

Regards
Reshmi
Oct 17 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
10420
by: Mark A Framness | last post by:
Greetings, I am working on a project and we need to write a conversion script to initialize a new field on a table. The number of records on this table is on the order of millions so routine...
6
4290
by: Agnes | last post by:
For i = 1 to 5000 Me.txtCounter.text = i 'As I found the textbox didn't update itself, I add (Me.txtCounter.update) '.... some calculation statment end for Me.txtcounter.update sometimes work...
9
1717
by: Jeff Gardner | last post by:
Greetings: I have an UPDATE query (php 5.1.6/mysql 5.0.24a on apache 2.2) that appears to execute with no errors (php,mysql, or apache) but the data in the "UPDATED" table doesn't change. I've...
2
3063
by: Shokoth | last post by:
I also wanted to know how to spread out sql statement over 3 lines. I am writing an sql update statment in VB. I have about 12 fields to update. strSQL = "UPDATE " & _ "Set . =...
2
18047
by: gimme_this_gimme_that | last post by:
I use the following SQL statment to bring z_emp_id values to a employee table: update employee set z_emp_id = (select z.emp_id from z.employee z where z.login=employee.login) Upon executing...
1
4023
by: naveenchhibber | last post by:
Hi all pls tell me that the following statment is valid in oracle 9i or 10g.. update ws set received_by_facility = coalesce(rbf_ouk.organizational_unit_id, 0), ...
2
1502
by: ramdil | last post by:
Hi All Please help me .Hope i have described my problem clearly below. I have a condition where i need to update some data in table from the value taken from another table.So basically i need to...
3
3931
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID...
1
1397
praclarush
by: praclarush | last post by:
I'm trying to connect to a access database and post an update to a row in a table though code with Visual Basic 2005, but when I do, I'm getting a Syntax error with the update statment. I don't...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.