久久久久久久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. 主站蜘蛛池模板: 国产精品欧美一区二区三区 | 国产成人福利在线观看 | 激情小视频 | 中文字幕成人av | 久草成人| 国产精品中文字幕在线播放 | 亚洲国产中文在线 | 成人免费在线观看 | 91美女在线 | 久久99久久98精品免观看软件 | 精品国产亚洲一区二区三区大结局 | 日韩精品1区2区3区 成人黄页在线观看 | 国产精品99久久久久久www | 日韩看片 | 国内精品视频在线 | 亚洲网站在线观看 | 亚洲3级 | 日本色高清 | 国产日韩在线观看一区 | 亚洲欧美在线观看 | 久久大陆 | 国产精品自产拍在线观看蜜 | 国产免费一区二区三区网站免费 | 国产乱码精品1区2区3区 | 日韩精品1区2区3区 爱爱综合网 | 午夜影视 | 日韩日韩日韩日韩日韩日韩日韩 | 欧美自拍一区 | 韩日在线 | xxxxx免费视频 | 精品国产乱码久久久久久中文 | 国产日韩一区二区三免费高清 | 黄色一级免费 | 在线成人 | 日韩一二三区视频 | 亚洲精品一区二区三区在线 | 日韩中文字幕 | 337p日本欧洲亚洲大胆 | 亚洲精品久久区二区三区蜜桃臀 | 性视频网 | 欧美一级片久久 |