久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='iNIJp'></tfoot>

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

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

      <legend id='iNIJp'><style id='iNIJp'><dir id='iNIJp'><q id='iNIJp'></q></dir></style></legend>

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

        檢查 MySQL 中日期范圍的重疊

        Check overlap of date ranges in MySQL(檢查 MySQL 中日期范圍的重疊)

              <tbody id='sC3r2'></tbody>

              <tfoot id='sC3r2'></tfoot>

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

                <legend id='sC3r2'><style id='sC3r2'><dir id='sC3r2'><q id='sC3r2'></q></dir></style></legend>

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

                  <i id='sC3r2'><tr id='sC3r2'><dt id='sC3r2'><q id='sC3r2'><span id='sC3r2'><b id='sC3r2'><form id='sC3r2'><ins id='sC3r2'></ins><ul id='sC3r2'></ul><sub id='sC3r2'></sub></form><legend id='sC3r2'></legend><bdo id='sC3r2'><pre id='sC3r2'><center id='sC3r2'></center></pre></bdo></b><th id='sC3r2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='sC3r2'><tfoot id='sC3r2'></tfoot><dl id='sC3r2'><fieldset id='sC3r2'></fieldset></dl></div>
                • 本文介紹了檢查 MySQL 中日期范圍的重疊的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  此表用于存儲(chǔ)會(huì)話(huà)(事件):

                  This table is used to store sessions (events):

                  CREATE TABLE session (
                    id int(11) NOT NULL AUTO_INCREMENT
                  , start_date date
                  , end_date date
                  );
                  
                  INSERT INTO session
                    (start_date, end_date)
                  VALUES
                    ("2010-01-01", "2010-01-10")
                  , ("2010-01-20", "2010-01-30")
                  , ("2010-02-01", "2010-02-15")
                  ;
                  

                  我們不想在范圍之間發(fā)生沖突.
                  假設(shè)我們需要插入一個(gè)從 2010-01-052010-01-25 的新會(huì)話(huà).
                  我們想知道沖突的會(huì)話(huà).

                  We don't want to have conflict between ranges.
                  Let's say we need to insert a new session from 2010-01-05 to 2010-01-25.
                  We would like to know the conflicting session(s).

                  這是我的查詢(xún):

                  SELECT *
                  FROM session
                  WHERE "2010-01-05" BETWEEN start_date AND end_date
                     OR "2010-01-25" BETWEEN start_date AND end_date
                     OR "2010-01-05" >= start_date AND "2010-01-25" <= end_date
                  ;
                  

                  結(jié)果如下:

                  +----+------------+------------+
                  | id | start_date | end_date   |
                  +----+------------+------------+
                  |  1 | 2010-01-01 | 2010-01-10 |
                  |  2 | 2010-01-20 | 2010-01-30 |
                  +----+------------+------------+
                  

                  有沒(méi)有更好的方法來(lái)獲得它?

                  Is there a better way to get that?

                  小提琴

                  推薦答案

                  我曾經(jīng)在一個(gè)日歷應(yīng)用程序中遇到過(guò)這樣的問(wèn)題.我想我使用了這樣的東西:

                  I had such a query with a calendar application I once wrote. I think I used something like this:

                  ... WHERE new_start < existing_end
                        AND new_end   > existing_start;
                  

                  UPDATE 這絕對(duì)有效((ns, ne, es, ee) = (new_start, new_end, existing_start, existing_end)):

                  UPDATE This should definitely work ((ns, ne, es, ee) = (new_start, new_end, existing_start, existing_end)):

                  1. ns - ne - es - ee:不重疊且不匹配(因?yàn)?ne
                  2. ns - es - ne - ee:重疊和匹配
                  3. es - ns - ee - ne:重疊和匹配
                  4. es - ee - ns - ne:不重疊且不匹配(因?yàn)?ns > ee)
                  5. es - ns - ne - ee:重疊和匹配
                  6. ns - es - ee - ne:重疊和匹配

                  <小時(shí)>

                  這是一個(gè)小提琴

                  這篇關(guān)于檢查 MySQL 中日期范圍的重疊的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數(shù)根據(jù) N 個(gè)先前值來(lái)決定接下來(lái)的 N 個(gè)行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達(dá)式的結(jié)果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數(shù)的 ignore 選項(xiàng)是忽略整個(gè)事務(wù)還是只是有問(wèn)題的行?) - IT屋-程序員軟件開(kāi)發(fā)技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時(shí)出錯(cuò),使用 for 循環(huán)數(shù)組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調(diào)用 o23.load 時(shí)發(fā)生錯(cuò)誤 沒(méi)有合適的驅(qū)動(dòng)程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數(shù)據(jù)庫(kù)表作為 Spark 數(shù)據(jù)幀讀取?)
                    1. <small id='2rDxP'></small><noframes id='2rDxP'>

                        <bdo id='2rDxP'></bdo><ul id='2rDxP'></ul>
                        <legend id='2rDxP'><style id='2rDxP'><dir id='2rDxP'><q id='2rDxP'></q></dir></style></legend>

                          <tbody id='2rDxP'></tbody>
                        <tfoot id='2rDxP'></tfoot>
                            <i id='2rDxP'><tr id='2rDxP'><dt id='2rDxP'><q id='2rDxP'><span id='2rDxP'><b id='2rDxP'><form id='2rDxP'><ins id='2rDxP'></ins><ul id='2rDxP'></ul><sub id='2rDxP'></sub></form><legend id='2rDxP'></legend><bdo id='2rDxP'><pre id='2rDxP'><center id='2rDxP'></center></pre></bdo></b><th id='2rDxP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2rDxP'><tfoot id='2rDxP'></tfoot><dl id='2rDxP'><fieldset id='2rDxP'></fieldset></dl></div>
                          1. 主站蜘蛛池模板: 天天看天天摸天天操 | 欧美天堂在线 | 久草成人 | 黄色大片在线播放 | 97精品国产97久久久久久免费 | 18gay男同69亚洲网站 | 亚洲精品中文字幕在线观看 | 欧美激情视频一区二区三区在线播放 | 婷婷色国产偷v国产偷v小说 | 毛片久久久 | 久久精品女人天堂av | 高清久久久 | www亚洲成人 | 欧美激情啪啪 | 久久综合一区 | 一区二区三区高清 | 精品一区二区三区在线观看 | 欧美精品在线一区二区三区 | 欧美久久电影 | 久久国| 日韩在线视频免费观看 | 一区二区中文 | 久久久久久成人 | 羞羞色网站 | 成人免费在线视频 | 国产三级国产精品 | 亚洲国产aⅴ精品一区二区 免费观看av | 日本午夜精品一区二区三区 | 日韩免费av一区二区 | 亚洲最新在线视频 | 国产无人区一区二区三区 | a在线视频观看 | 91精品国产一区二区三区 | 色.com| 国产精品成人在线 | 成人久久久 | 久久精品国产一区二区三区 | 亚洲精品区 | 操久久 | 欧美精品在线一区二区三区 | 在线国产一区二区 |