Home > database >  The oracle database query
The oracle database query

Time:09-22

Query was born in 1988 students (tt_student) table, show student id, name, date of birth (note: this problem can't date of birth field can be used to calculate, age can be used to calculate) how to write bits a great god!!

CodePudding user response:

The select student_id, name, born_date
The from tt_student
Where to_char (sysdate, 'yyyy) - to_char (born_date,' yyyy)=30

CodePudding user response:

The select student_id, name, born_date
The from tt_student
Where to_date (sysdate, 'yyyy) - to_date (born_date,' yyyy)=30

CodePudding user response:

Upstairs, the date can't use to_date

CodePudding user response:

The select student_id, name, born_date
The from tt_student
Where to_char (sysdate, 'yyyy) - to_char (born_date,' yyyy)=30

CodePudding user response:

The select student_id, name, born_date
The from tt_student
Where to_char (sysdate, 'yyyy) - to_char (born_date,' yyyy)=30

CodePudding user response:

The select student_id, name, born_date
The from tt_student
Where to_char (sysdate, 'yyyy) - to_char (born_date,' yyyy)=30

CodePudding user response:

reference 1st floor yaiger response:
select student_id, name, born_date
The from tt_student
Where to_char (sysdate, 'yyyy) - to_char (born_date,' yyyy)=30



If I don't know is 30 cases

CodePudding user response:

The select student_id, name, born_date
The from tt_student
Where to_char (sysdate, 'yyyy) - to_char (born_date,' yyyy)=
(to_char (sysdate, 'yyyy) - 1998)

CodePudding user response:

refer to 7th floor weixin_41920152 response:
Quote: refer to 1st floor yaiger response:

The select student_id, name, born_date
The from tt_student
Where to_char (sysdate, 'yyyy) - to_char (born_date,' yyyy)=30



If I don't know is 30 cases

The select student_id, name, born_date
The from tt_student
Where to_char (sysdate, 'yyyy) - to_char (born_date,' yyyy)=
(to_char (sysdate, 'yyyy) - 1988)

CodePudding user response:

Always have a query condition? 30 this is a variable?

refer to 7th floor weixin_41920152 response:
Quote: refer to 1st floor yaiger response:

The select student_id, name, born_date
The from tt_student
Where to_char (sysdate, 'yyyy) - to_char (born_date,' yyyy)=30



If I don't know is 30 cases
  • Related