Home > database >  Oracle great god into
Oracle great god into

Time:09-30

Have two pieces of students table and gradebooks

Students table with id name
Gradebooks have student ID credits
Student ID is the table's primary key

Students table data (1001, 'xiao Ming')
Students table data (1001, 60)

How to update the xiao Ming's credits

CodePudding user response:

Didn't see the building Lord what to do,

How to update, where the data come from?

Update gradebooks set credits=100 where id=1

Is not so simple,

CodePudding user response:

 update st2 set score=70 where id=(select id from st1 where name='Ming') 

CodePudding user response:

2 l comprehensive, see the subquery

CodePudding user response:

Mean that needs to be updated by name credits? It is 2 l, or are too simple,,,

CodePudding user response:

The update st2 set score=70 where id=(select id from st1 where name='Ming')
  • Related