Home » Other » Training & Certification » help in a oracle sql command
help in a oracle sql command [message #311976] Mon, 07 April 2008 10:41 Go to next message
a_choch
Messages: 2
Registered: April 2008
Location: israel
Junior Member
hello i have 2 commands and i cant figure out what is the command doing and what is the final answer.
i will thank very much for an answer
1.select (next_day(last_day(sysdate),'SAT') - next_day(last_day
(add_months(sysdate,-1)),'SAT')) / 7

from dual

2.Select max(a)
from t
where a < (select max(a) from t where a < (select max(a) from t))
Re: help in a oracle sql command [message #311978 is a reply to message #311976] Mon, 07 April 2008 10:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Seems to be a homework, doesn't it?

What is your opinion?

What does "last_day(sysdate)" give?
Then what does "next_day(<a date>,'SAT'))" give?
Then what does "add_months(sysdate,-1)" give?
And so on...

What does "select max(a) from t" give?
Then what does "select max(a) from t where a < (select max(a) from t)" give?
And so on...

Regards
Michel
Re: help in a oracle sql command [message #312001 is a reply to message #311978] Mon, 07 April 2008 12:18 Go to previous messageGo to next message
a_choch
Messages: 2
Registered: April 2008
Location: israel
Junior Member
thanks.
and yes it is homework the thing with this commands that we just got this commands wich mens that i dont know what each thing gives you have any idea maybe??
tahnks again
asaf
Re: help in a oracle sql command [message #312002 is a reply to message #312001] Mon, 07 April 2008 12:28 Go to previous message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Database SQL Reference
Chapter 5 Functions
Section SQL Functions

Regards
Michel
Previous Topic: How long the training certificate valid for
Next Topic: PL/SQL follow-up
Goto Forum:
  


Current Time: Sat Dec 03 00:44:17 CST 2016

Total time taken to generate the page: 0.05629 seconds