Home » SQL & PL/SQL » SQL & PL/SQL » My very first Insert - Can I get some assistance please:)
My very first Insert - Can I get some assistance please:) [message #190134] Tue, 29 August 2006 06:12 Go to next message
australiannewbee
Messages: 1
Registered: August 2006
Location: Australia
Junior Member
Hi there,

I just started with SQL yesterday and I have got all the 'selects' and 'wheres' happening but now I need to do 2 inserts.

Insert (1) - I have the following criteria for my insert:
Table Name = FEE
Column Names = FEETYPE & BASEDON

I need to insert the value '0' into 'BASEDON' where the FEETYPE is either the value '4' or '5'. How do I write this?

--------------------------------------------------------

Insert (2) - I have the following criteria for my insert:

Table Name 1 = PRICINGPROFILE
Column Names = PRICINGPROFILEID

Table Name 2 = PRICINGPROFILEFEES
Column Names = PRICINGPROFILEID & FEEID

Table Name 3 = FEE
Column Names = FEEID & FEETYPE & RELATED_FEEID

I need to insert into FEE.RELATED_FEEID where the FEE.RELATED_FEEID has a FEE.FEETYPE = ANY('1','2','3','4')
the FEE.FEEID for the FEE.FEETYPE = '5' where the FEE.FEEID = '5' is associated to the other FEE.FEEID's by PRICINGPROFILE.PRICINGPROFILEID by liking the FEEID's to PRICINGPROFILEID's in PRICINGPROFILEFEES.FEEID & PRICINGPROFILEFEES.PRICINGPROFILEID. Pheww! Can somebody help me write this one too? Its just my second day Smile

This could be another way of saying the same thing:
Where PRICINGPROFILEID in PRICINGPROFILE table has subsequent associated FEEID's (located in the PRICINGPROFILEFEES table), In the FEE table, If in the FEETYPE = 5 for one of the associated FEEID's in the PRICINGPROFILEFEES table, Insert the FEEID (for FEETYPE = 5) into RELATED_FEEID for FEETYPES = (1,2,3,4) for FEEID associated to PRICINGPROFILEID in PRICINGPROFILEFEES

Thanks to anybody that can help me learn! SQL is so much fun.
Re: My very first Insert - Can I get some assistance please:) [message #190259 is a reply to message #190134] Tue, 29 August 2006 22:47 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
australiannewbee wrote on Tue, 29 August 2006 21:12


Thanks to anybody that can help me learn! SQL is so much fun.

Know what's even more fun? The manuals.
Re: My very first Insert - Can I get some assistance please:) [message #190306 is a reply to message #190134] Wed, 30 August 2006 02:47 Go to previous message
sunsanvin
Messages: 60
Registered: April 2006
Location: Hyderabad
Member

Hello friend, there is a very good site for you learn basics of sql

http://www.w3schools.com/sql/default.asp

go through this link
Previous Topic: resize partioned column ?
Next Topic: adding time to dates
Goto Forum:
  


Current Time: Thu Dec 08 02:31:41 CST 2016

Total time taken to generate the page: 0.20690 seconds