• <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 如何选择最近的日期项

        SQL How to Select the most recent date item(SQL 如何选择最近的日期项)
            <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 如何选择最近的日期项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Accessing another user#39;s table within an Oracle Stored Procedure(在 Oracle 存储过程中访问另一个用户的表)
                  Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)(超出最大存储过程、函数、触发器或视图嵌套级别(限制 32))
                  How to View Oracle Stored Procedure using SQLPlus?(如何使用 SQLPlus 查看 Oracle 存储过程?)
                  How to debug stored procedure in VS 2015?(如何在 VS 2015 中调试存储过程?)
                  How to Pass Java List of Objects to Oracle Stored Procedure Using MyBatis?(如何使用 MyBatis 将 Java 对象列表传递给 Oracle 存储过程?)
                  Set the variable result, from query(设置变量结果,来自查询)
                    <tbody id='qZTCr'></tbody>
                • <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>