Oracle date paging

Source: Internet
Author: User
No details no select * fromli. bookswherebook_publish_datebetween1-august 1-August 1-August 1-August 1-August 2010; select * nation; select * frombookswherecatalog_idin

No details no select * from li. books where book_publish_date between '1-February-2005 'and '1-February-2010'; select * from books where book_price between 50 and 60; select * from books where catalog_id in (select catalog_id from catalogs where catalog

<无详细内容> <无>
Select * from li. books where book_publish_date between '1-February-2005 'and '1-February-2010'; select * from books where book_price between 50 and 60; select * from books where catalog_id in (select catalog_id from catalogs where catalog_name = 'database'); select * from catalogs; --- dual table select * from dual; -obtain the oracle system date select sysdate from dual; -- add 10 days to the previous date select sysdate + 10 from dual; select (select from dual) + 10 from dual; -- Date function select add_months (sysdate, 4) from dual; select add_months ('2-January 1, February-1990 ', 4) from dual; -obtain select last_day (sysdate) from dual on the last day of the specified month; select last_day ('2-January 1, February-2014 ') from dual; --- calculate the difference between the two months. select months_between (sysdate, '27-April-2014 ') from dual; ---- round the date --- select round (sysdate, 'Year') by year ') from dual; -- select round (sysdate, 'month') from dual; select round (select to_date ('2017-4-15 ', 'yyyy-MM-dd ') from dual), 'month') from dual; select to_date ('1970-3-1 ', 'yyyy-MM-dd') from dual -- select round (sysdate, 'day') from dual; -- next_day, get the date of the next day of the specified date select next_day (sysdate, 2) from dual; the day of the next week; select next_day ('27-August-2014 ', 2) from dual; -- current date of the stage -- select trunc (sysdate, 'Year') from dual; -- select trunc (sysdate, 'month') from dual by month; -- select trunc (sysdate, 'day') from dual by week; -- compare the maximum values of a set of numbers: select greatest (2014, 2011,) from dual; select greatest ('12-March-', '12-March ', '12-September-2000 ') from dual; --- use of the string function -- truncates a string (starting from the nth character and intercepting a string of M characters) select substr ('helloworld', 3,5) from dual; -- Obtain the character position in the specified string select instr ('hello', 'O') from dual; -- Get the string length select length ('liubaihua') from dual; -- Conversion Function -- convert other types of data to a string (the most commonly used is to convert a date to a string) -- convert the date to the string select to_char (sysdate, 'yyyy-mm-dd') from dual; select sysdate from dual; -- convert the number to the string select to_char (9898.33, '$99999.999 ') from dual; -- convert other data to the date format (usually convert string to date) select to_date ('2017-3-1 ', 'yyyy-MM-dd') from dual; -- date ratio, obtain the maximum value of a set of dates select greatest (to_date ('2017-4-22 ', 'yyyy-MM-dd'), to_date ('2017-5-1 ', 'yyyy-MM-dd'), to_date ('1970-12-22 ', 'yyyy-MM-dd') from dual; select '4' + '5' from dual; select 4 + 5 from dual; -- get the user's login IDselect uid from books; select user from dual; -- aggregate function select sum (book_price) from books; select count (book_id) from books; --- select * from (select books. *, rownum r from books where rownum <= 6) where r> 2; select books. *, rownum from books where rownum <= 5; --- group by select catalog_id from books order by catalog_id; select * from books; --- having select catalog_id, sum (book_price) from books group by catalog_id having sum (book_price) >=100 order by catalog_id;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.