• <i id='NRag1'><tr id='NRag1'><dt id='NRag1'><q id='NRag1'><span id='NRag1'><b id='NRag1'><form id='NRag1'><ins id='NRag1'></ins><ul id='NRag1'></ul><sub id='NRag1'></sub></form><legend id='NRag1'></legend><bdo id='NRag1'><pre id='NRag1'><center id='NRag1'></center></pre></bdo></b><th id='NRag1'></th></span></q></dt></tr></i><div id='NRag1'><tfoot id='NRag1'></tfoot><dl id='NRag1'><fieldset id='NRag1'></fieldset></dl></div>

    1. <small id='NRag1'></small><noframes id='NRag1'>

        <bdo id='NRag1'></bdo><ul id='NRag1'></ul>

      <tfoot id='NRag1'></tfoot>
      1. <legend id='NRag1'><style id='NRag1'><dir id='NRag1'><q id='NRag1'></q></dir></style></legend>
      2. SQL 如何选择最近的日期项

        时间:2023-10-26
            <tbody id='CrLvd'></tbody>

          1. <legend id='CrLvd'><style id='CrLvd'><dir id='CrLvd'><q id='CrLvd'></q></dir></style></legend>
                <bdo id='CrLvd'></bdo><ul id='CrLvd'></ul>

                  <i id='CrLvd'><tr id='CrLvd'><dt id='CrLvd'><q id='CrLvd'><span id='CrLvd'><b id='CrLvd'><form id='CrLvd'><ins id='CrLvd'></ins><ul id='CrLvd'></ul><sub id='CrLvd'></sub></form><legend id='CrLvd'></legend><bdo id='CrLvd'><pre id='CrLvd'><center id='CrLvd'></center></pre></bdo></b><th id='CrLvd'></th></span></q></dt></tr></i><div id='CrLvd'><tfoot id='CrLvd'></tfoot><dl id='CrLvd'><fieldset id='CrLvd'></fieldset></dl></div>

                  <small id='CrLvd'></small><noframes id='CrLvd'>

                • <tfoot id='CrLvd'></tfoot>
                  本文介绍了SQL 如何选择最近的日期项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  你好,我有一个带列的表:

                  Hello I have a table with columns:

                  *使用oracle

                  ID                  NUMBER
                  USER_ID            NUMBER
                  DATE_ADDED          DATE
                  DATE_VIEWED        DATE
                  DOCUMENT_ID        VARCHAR2
                  URL                VARCHAR2
                  DOCUMENT_TITLE      VARCHAR2
                  DOCUMENT_DATE        DATE
                  

                  我想知道如何获取给定用户最近添加的文档.

                  I want to know how i can get the most recently added document for a given user.

                  Select * FROM test_table WHERE user_id = value AND (do something with date_added column)
                  

                  谢谢

                  推荐答案

                  Select * 
                  FROM test_table 
                  WHERE user_id = value 
                  AND date_added = (select max(date_added) 
                     from test_table 
                     where user_id = value)

                  这篇关于SQL 如何选择最近的日期项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:oracle中select语句中的子查询是如何工作的 下一篇:ORA-01843 不是有效月份 - 比较日期

                  相关文章

                • <small id='qZTCr'></small><noframes id='qZTCr'>

                  <legend id='qZTCr'><style id='qZTCr'><dir id='qZTCr'><q id='qZTCr'></q></dir></style></legend>
                    <bdo id='qZTCr'></bdo><ul id='qZTCr'></ul>
                • <i id='qZTCr'><tr id='qZTCr'><dt id='qZTCr'><q id='qZTCr'><span id='qZTCr'><b id='qZTCr'><form id='qZTCr'><ins id='qZTCr'></ins><ul id='qZTCr'></ul><sub id='qZTCr'></sub></form><legend id='qZTCr'></legend><bdo id='qZTCr'><pre id='qZTCr'><center id='qZTCr'></center></pre></bdo></b><th id='qZTCr'></th></span></q></dt></tr></i><div id='qZTCr'><tfoot id='qZTCr'></tfoot><dl id='qZTCr'><fieldset id='qZTCr'></fieldset></dl></div>

                  1. <tfoot id='qZTCr'></tfoot>