Home » SQL & PL/SQL » SQL & PL/SQL » select query (oracle 10g)
select query [message #410908] Wed, 01 July 2009 00:53 Go to next message
rajasekhar857
Messages: 500
Registered: December 2008
Senior Member
hi i am having tables like
select * from EMRAppointmentDetails where patient_id =803532
select * from EMRTPBilledItems where patient_id =803532
select * from EMRAppointmentDetailsHistory where patient_id =803532

select * from EMRTransactionsTemp where patient_id =803532
--select * from EMRTransactions where patient_id ='803532'
select * from EMRSupplementaryTransactions where patient_id =803532

i want a select query for the above table conditions.
1)if visit_type_id column from emrappointmentdetails!=10

then EMRSupplementaryTransactions records should be moved to
EMRTransactions table.

2)delete the records in EMRSupplementaryTransactions table.
3)what ever the values in EMRTransactionsTemp should be updated or inserted for EMRSupplementaryTransactions table

[Updated on: Wed, 01 July 2009 01:04] by Moderator

Report message to a moderator

Re: select query [message #410916 is a reply to message #410908] Wed, 01 July 2009 01:07 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So proceed to do so.

Regards
Michel
Re: select query [message #410918 is a reply to message #410916] Wed, 01 July 2009 01:11 Go to previous messageGo to next message
rajasekhar857
Messages: 500
Registered: December 2008
Senior Member
can you explain me for this
Re: select query [message #410921 is a reply to message #410918] Wed, 01 July 2009 01:16 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is the question?

Regards
Michel
Re: select query [message #410922 is a reply to message #410908] Wed, 01 July 2009 01:18 Go to previous messageGo to next message
ashoka_bl
Messages: 398
Registered: November 2006
Location: Bangalore
Senior Member

Can you provide the necessary information !!

As we all know we are not working with you in your company, so we don't have any DDLs and DMLs and required business information.
Quote:
i want a select query for the above table conditions.
1)if visit_type_id column from emrappointmentdetails!=10

then EMRSupplementaryTransactions records should be moved to
EMRTransactions table.

2)delete the records in EMRSupplementaryTransactions table.
3)what ever the values in EMRTransactionsTemp should be updated or inserted for EMRSupplementaryTransactions table

use Insert/update/delete for above !!

[Updated on: Wed, 01 July 2009 01:23] by Moderator

Report message to a moderator

Re: select query [message #410924 is a reply to message #410921] Wed, 01 July 2009 01:20 Go to previous messageGo to next message
rajasekhar857
Messages: 500
Registered: December 2008
Senior Member
i am having a table emrappointmentdetails where visit_type_id is one column.if it is other than 10 then the records in emrsupplementarytransactions should be moved to emrtransactions table.and what ever the records in emrsupplementarytransactions should get deleted.and that paricular table should be updated or inserted by the values from EMRTransactionsTemp table.
i want a select query for this.
Re: select query [message #410927 is a reply to message #410908] Wed, 01 July 2009 01:23 Go to previous messageGo to next message
ashoka_bl
Messages: 398
Registered: November 2006
Location: Bangalore
Senior Member

You want everything that you mentioned in a single select statement ( I am still understanding the requirement(is it ??)
Re: select query [message #410928 is a reply to message #410924] Wed, 01 July 2009 01:23 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
A select can't update or insert or delete.

Regards
Michel
Re: select query [message #410930 is a reply to message #410928] Wed, 01 July 2009 01:28 Go to previous messageGo to next message
rajasekhar857
Messages: 500
Registered: December 2008
Senior Member
ok then how can i proceed that
Re: select query [message #410933 is a reply to message #410924] Wed, 01 July 2009 01:32 Go to previous messageGo to next message
bonker
Messages: 402
Registered: July 2005
Senior Member
Why is it so difficult for you write the required Insert, Update and Delete Statement?

Re: select query [message #410935 is a reply to message #410908] Wed, 01 July 2009 01:36 Go to previous messageGo to next message
ashoka_bl
Messages: 398
Registered: November 2006
Location: Bangalore
Senior Member

ok then how can i proceed that 


Rajshekhar, Just think about us,

* We don't have any further information of what to do(We are not sure whether you need select/insert/update/delete).

* We do not have any test case/ddl/dml to support

* You haven't posted it in a most understandable format

Well...Do you know anybody out there in your company who can understand your requirement and solve the issue
Re: select query [message #410996 is a reply to message #410930] Wed, 01 July 2009 08:06 Go to previous message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
rajasekhar857 wrote on Wed, 01 July 2009 02:28
ok then how can i proceed that


Another escapee from the loony bin.
Previous Topic: sql max
Next Topic: Could you please help me in joining these tables
Goto Forum:
  


Current Time: Sat Dec 03 16:11:11 CST 2016

Total time taken to generate the page: 0.07484 seconds