|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
insert into where column = somevalue
Code:
insert into SJ5752.quadrat_dataplots(HEIGHT,SPECIES,STATE,MORPH) select HEIGHT,SPECIES,STATE,MORPH from SJ5752.quadrat_dataplots where PLOTID ='plot 1' Code:
insert into SJ5752.quadrat_dataplots(HEIGHT,SPECIES,STATE,MORPH)
values('12.5','sg','l','no') where PLOTID = 'plot 1'
I have tried both of the above and both failed to work. I want to insert only into a row where PLOTID = some value What can i do? |
|
#2
|
||||
|
||||
|
Maybe you are trying to update an existing row where PLOTID = 'plot 1' with new values?
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
You have to use UPDATE.
INSERT creates a new row, UPDATE is used to modify existing ones |
|
#4
|
|||
|
|||
|
Quote:
Thank you |
|
#5
|
|||
|
|||
|
I tried:
Code:
update SJ5752.quadrat_dataplots set (HEIGHT,SPECIES, STATE,MORPH) = ( select HEIGHT,SPECIES,STATE,MORPH from SJ5752.quadrat_dataplots where PLOTID = 'plot 1' ) but it doesn't have the desired effect, any ideas? |
|
#6
|
||||
|
||||
|
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > insert into where column = somevalue |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|