本文介紹了在 MySQL 中生成整數序列的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我需要與一個表/結果集/任何具有整數 n
到 m
的連接進行連接.有沒有一種簡單的方法可以在不構建表格的情況下獲得它?
I need to do a join with a table/result-set/whatever that has the integers n
to m
inclusive. Is there a trivial way to get that without just building the table?
(順便說一句,這種類型的構造會被稱為什么,元查詢"?)
(BTW what would that type of construct be called, a "Meta query"?)
m-n
被限制在合理范圍內(<1000's)
m-n
is bounded to something reasonable ( < 1000's)
推薦答案
沒有序列號生成器 (CREATE SEQUENCE) 在 MySQL 中.最接近的是AUTO_INCREMENT
,它可以幫助您構建表格.
There is no sequence number generator (CREATE SEQUENCE) in MySQL. Closest thing is AUTO_INCREMENT
, which can help you construct the table.
這篇關于在 MySQL 中生成整數序列的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!