473,425 Members | 1,776 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

Help with update statement

OraMaster
135 100+
Hi

I have two tables along with staructure and sample data below.

Table 1 :

final_temp(club_id nvarchar(36), effective_date datetime,club_status nvarchar2(20), termination_reason nvarchar2(50))

club_id effective_date club_status termination_reason
-----------------------------------------------------------------------------------
1 01-Apr-2001 Active
1 01-Apr-1998 Terminated Payment Due
1 01-Jun-1982 Active
------------------------------------------------------------------------------------

Table 2:
client_ri_idhistory(club_id nvarchar2(36), seqnum int, effective_date datetime, newdata nvarchar2(50))

club_id seqnum effective_date newdata
------------------------------------------------------------------
1 13432 01-Apr-2001 Active
1 62378 01-Apr-1998 Terminated
1 83723 01-Apr-1998 Reactivated
-------------------------------------------------------------------

Now if there are more than one record with same effective_date for one club_id in client_ri_idhistory table with 'Terminated' and 'Reactivated' statuses then I need to update club_status = 'Active' in final_temp table for the same club_id and effective_date.

Please let me know if you need more information on the same.

Thanks!
Bhushan
Apr 7 '10 #1
0 863

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

Similar topics

8
by: Cherrish Vaidiyan | last post by:
hello googles, I have a small sqlplus problem. i have created a table with date field along with other varchar2,number etc. But unfortunately i made a mistake in entering the date. for some date...
6
by: Simon | last post by:
Hello, I am trying to update some varchar2 fields, which are storing dates. I am trying to set a 'to date' with the next minumum from date i.e from date | to date 01/01/1901 ...
15
by: Philip Mette | last post by:
I am begginner at best so I hope someone that is better can help. I have a stored procedure that updates a view that I wrote using 2 cursors.(Kind of a Inner Loop) I wrote it this way Because I...
18
by: Bill Smith | last post by:
The initial row is inserted with the colPartNum column containing a valid LIKE pattern, such as (without the single quotes) 'AB%DE'. I want to update the column value with the results of a query...
4
by: jbow0527 | last post by:
Here is what I have: Table1 with two key fields: PartNum and WH# (warehouse number) Table2 with only one key field: PartNum Both tables contain a field called Price. I want to update Table1...
1
by: Viktor Popov | last post by:
Hi , I have a form in which I show UserInfo from the DataBase using Stored Procedure and I populate 5 TextBox controls with this information in this way: private void Page_Load(object sender,...
28
by: Siv | last post by:
Hi, If I run the following: strSQL = "Select * FROM Clients;" da = New OleDb.OleDbDataAdapter(strSQL, Conn) 'Create data adapter cb = New OleDb.OleDbCommandBuilder(da) ...
1
by: Grant McLean | last post by:
Hi First a simple question ... I have a table "access_log" that has foreign keys "app_id" and "app_user_id" that reference the "application_type" and "app_user" tables. When I insert into...
1
by: cindy | last post by:
this is the call private void Page_Load(object sender, System.EventArgs e) { OdbcConnection connection = new OdbcConnection ("DSN=PFW52"); CreateDataAdapter(connection); } this is the code,...
1
by: contactrajib | last post by:
I have a situation where one of the app server thread is executing an update statement on A record and at the same time another thread is trying to read it by executing a select query. Now we are...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
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
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...

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.