How does Oracle query data based on time, for example, if I query data from 2011 07 08 17 14 16?

Updated on technology 2024-02-09
13 answers
  1. Anonymous users2024-02-05

    select * from table_name where to_char(col_date,'yyyy-mm-dd hh24:mi:ss') = '2011-07-08 17:

    select * from table_name where col_date = to_date('2011-07-08 17:14:16','yyyy-mm-dd hh24:

    mi:ss') ;

    If you search the Internet, you can see the usage of the to char() to date() functions.

  2. Anonymous users2024-02-04

    The time of the database is obtained from the system, so it is enough to modify the time of the system directly.

    If the clock is inaccurate, we recommend that you enable the clock synchronization service on the operating system.

  3. Anonymous users2024-02-03

    Stop the database, then modify the system time, and then restart the database.

  4. Anonymous users2024-02-02

    You can directly change the operating system time of the database server.

  5. Anonymous users2024-02-01

    Generally two months later, in June, the August rush can be found in the field, and your difference this time is not much in mid to late February, so you don't have to wait until the start of school. I wish you well in passing the exam.

  6. Anonymous users2024-01-31

    Around March 2012, it will be done.

  7. Anonymous users2024-01-30

    Your when condition compares the size of 2 strings, and the string format is 'dd-mon-yy'Note that the first character of your qualifier is '0', so your comparison results are 'false'', so you just need to change to date comparison, when hire date < to date('01-Jan-95','dd-mono-yy')

    Hope it helps.

  8. Anonymous users2024-01-29

    The first SQL, you're comparing with strings.

    The first letter will be compared sequentially, and if it is the same, it will be compared in turn.

    Therefore, as long as the first two letters are greater than 01, false will be output.

    The following SQL is more normal, you are using the date type to compare.

  9. Anonymous users2024-01-28

    Execute the following command: select to char(sysdate,'dd-mon-yy') from dual;

    Look what the result is, mine is: 01-may-14

    I suspect that your to date may not have worked out.

    For character date conversion, it is recommended to use yyyy-mm-dd when hire date < to date('1990-01-01','yyyy-mm-dd') then '90'

  10. Anonymous users2024-01-27

    Directly subtract date a - date b will make a difference by a value, this value is in days, and you need to multiply 24*60*60 to calculate how many seconds the time difference is.

  11. Anonymous users2024-01-26

    1: select * from a where Creation time = to date('2011-05-04 18:20:

    11','yyyy-mm-dd hh24:mi:ss')

    2: select * from a where to char (Creation time,.)'yyyy-mm-dd hh24:mi:

    ss') = '2011-05-04 18:20:11'

    If your Create Time field is character-based, it's easier to select * from a where Creation Time ='2011-05-04 18:20:11'

  12. Anonymous users2024-01-25

    1--- Convert the value of the query to a date for comparison, select * from a where create date = to date('2011-05-04 18:20:11','yyyy-mm-dd hh24:

    mi:ss')

    2--- Convert the date field to a string for comparison, select * from a where to char(create date,'yyyy-mm-dd hh24:mi:ss') = '2011-05-04 18:

  13. Anonymous users2024-01-24

    Woo woo Maintenance for so long I ate 2 bottles of old wine for nothing.

Related questions
5 answers2024-02-09

You can contact a Pearson Vue agent at Pearson VUE, or contact the test center directly. >>>More

14 answers2024-02-09

domain name:

registrar: xiamen chinasource internet service co., ltd. >>>More

14 answers2024-02-09

Create table as **selectThe table should exist in the data dictionary, so that the table can be created successfully, you have a complex subquery, such as count(*)as samplid, how does the database know whether samplid should be created as int or bigint? It is recommended that you split the dynamic statement into two statements, one for the regular table creation statement and the other for the insert statement.

11 answers2024-02-09

Visually, your stored procedure needs to run at these moments: >>>More

10 answers2024-02-09

select top(1)* from table_name order by update_time desc

My idea is to find the result of the first place in descending order of modification time, isn't it? >>>More