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

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

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

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

        在 MySQL 查詢的 WHERE 子句中使用列別名會(huì)產(chǎn)生錯(cuò)誤

        Using column alias in WHERE clause of MySQL query produces an error(在 MySQL 查詢的 WHERE 子句中使用列別名會(huì)產(chǎn)生錯(cuò)誤)
            <tbody id='w2j0e'></tbody>
          <legend id='w2j0e'><style id='w2j0e'><dir id='w2j0e'><q id='w2j0e'></q></dir></style></legend>
            • <bdo id='w2j0e'></bdo><ul id='w2j0e'></ul>

              <tfoot id='w2j0e'></tfoot>

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

                <i id='w2j0e'><tr id='w2j0e'><dt id='w2j0e'><q id='w2j0e'><span id='w2j0e'><b id='w2j0e'><form id='w2j0e'><ins id='w2j0e'></ins><ul id='w2j0e'></ul><sub id='w2j0e'></sub></form><legend id='w2j0e'></legend><bdo id='w2j0e'><pre id='w2j0e'><center id='w2j0e'></center></pre></bdo></b><th id='w2j0e'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='w2j0e'><tfoot id='w2j0e'></tfoot><dl id='w2j0e'><fieldset id='w2j0e'></fieldset></dl></div>
                  本文介紹了在 MySQL 查詢的 WHERE 子句中使用列別名會(huì)產(chǎn)生錯(cuò)誤的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在運(yùn)行的查詢?nèi)缦拢俏沂盏酱隋e(cuò)誤:

                  <塊引用>

                  #1054 - 'IN/ALL/ANY 子查詢'中的未知列'guaranteed_postcode'

                  SELECT `users`.`first_name`, `users`.`last_name`, `users`.`email`,SUBSTRING(`locations`.`raw`,-6,4) AS `guaranteed_postcode`從 `users` LEFT OUTER JOIN `locations`ON `users`.`id` = `locations`.`user_id`WHERE `guaranteed_postcode` NOT IN #這是使用假冒號(hào)的地方(SELECT `postcode` FROM `postcodes` WHERE `region` IN('澳大利亞'))

                  我的問題是:為什么我不能在同一個(gè)數(shù)據(jù)庫(kù)查詢的 where 子句中使用假列?

                  解決方案

                  您只能在 GROUP BY、ORDER BY 或 HAVING 子句中使用列別名.

                  <塊引用>

                  標(biāo)準(zhǔn) SQL 不允許您引用 WHERE 中的列別名條款.強(qiáng)加了這個(gè)限制因?yàn)楫?dāng) WHERE 代碼是已執(zhí)行,列值可能尚未確定.

                  復(fù)制自 MySQL 文檔

                  正如評(píng)論中所指出的,改用 HAVING 可能會(huì)完成這項(xiàng)工作.請(qǐng)務(wù)必閱讀此問題:WHERE vs HAVING.

                  The query I'm running is as follows, however I'm getting this error:

                  #1054 - Unknown column 'guaranteed_postcode' in 'IN/ALL/ANY subquery'

                  SELECT `users`.`first_name`, `users`.`last_name`, `users`.`email`,
                  SUBSTRING(`locations`.`raw`,-6,4) AS `guaranteed_postcode`
                  FROM `users` LEFT OUTER JOIN `locations`
                  ON `users`.`id` = `locations`.`user_id`
                  WHERE `guaranteed_postcode` NOT IN #this is where the fake col is being used
                  (
                   SELECT `postcode` FROM `postcodes` WHERE `region` IN
                   (
                    'australia'
                   )
                  )
                  

                  My question is: why am I unable to use a fake column in the where clause of the same DB query?

                  解決方案

                  You can only use column aliases in GROUP BY, ORDER BY, or HAVING clauses.

                  Standard SQL doesn't allow you to refer to a column alias in a WHERE clause. This restriction is imposed because when the WHERE code is executed, the column value may not yet be determined.

                  Copied from MySQL documentation

                  As pointed in the comments, using HAVING instead may do the work. Make sure to give a read at this question too: WHERE vs HAVING.

                  這篇關(guān)于在 MySQL 查詢的 WHERE 子句中使用列別名會(huì)產(chǎn)生錯(cuò)誤的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(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è)先前值來決定接下來的 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ù)還是只是有問題的行?) - IT屋-程序員軟件開發(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ò)誤 沒有合適的驅(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ù)幀讀取?)

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

                    <tbody id='I5npE'></tbody>

                      1. <legend id='I5npE'><style id='I5npE'><dir id='I5npE'><q id='I5npE'></q></dir></style></legend>
                        <tfoot id='I5npE'></tfoot>
                          <bdo id='I5npE'></bdo><ul id='I5npE'></ul>
                          <i id='I5npE'><tr id='I5npE'><dt id='I5npE'><q id='I5npE'><span id='I5npE'><b id='I5npE'><form id='I5npE'><ins id='I5npE'></ins><ul id='I5npE'></ul><sub id='I5npE'></sub></form><legend id='I5npE'></legend><bdo id='I5npE'><pre id='I5npE'><center id='I5npE'></center></pre></bdo></b><th id='I5npE'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='I5npE'><tfoot id='I5npE'></tfoot><dl id='I5npE'><fieldset id='I5npE'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 中国av在线| 精品三级在线观看 | 午夜精品在线观看 | 久久久精品一区二区 | 小sao货撅起屁股扒开c微博 | 成人免费网站黄 | 美女黄色大片 | av毛片在线播放 | 日本在线视频一区 | 欧美综合在线观看 | 一区二区三区精品视频 | 欧美精品在线免费观看 | av片网站| 夜夜欢天天干 | 久久精品一二三 | 三级黄色片网站 | 五月激情久久 | 午夜精品一区二区三区在线播放 | 国产一区二区视频在线播放 | 亚洲黄色av | 色多多视频在线观看 | 欧美在线视频观看 | 国产欧美成人 | 日韩av资源 | 五月婷婷六月天 | 久久久精品国产sm调教网站 | 日韩久久久久 | 一级理论片 | 久在线视频| 国产精品久久久久久久久久久久久 | 在线免费观看黄色片 | 国产成年妇视频 | 亚洲激情视频在线观看 | 九月丁香婷婷 | 日韩一级在线观看 | 成人黄色大片 | 国产无遮挡又黄又爽免费网站 | 国产成人在线观看免费网站 | 欧美三级大片 | 国产日韩久久 | 日本成人精品 |