1
我已經在MySQL數據庫(5.7.17-0ubuntu0.16.04.2)中加載了路徑,並且用戶選擇了路徑選擇,我想選擇所有這些路徑和下面的,但我遇到了一個問題。MySQL REGEXP Match/or End of Field
假定用戶要「/根/ K」我需要爲做一個選擇:
a. /root/K%
b. /root/K
我怎樣才能獲得REGEXP到現場或/結束匹配嗎?
我已經試過如下:
原始查詢:
where path REGEXP ('/root/K/|/root/J/J/') # this works but doesn't show the items in that path, only ones below
where path REGEXP '/root/K[/\z]' # does the same as above
where path REGEXP '/root/K(?=/|$)' # Get error 1139, repetition-operator invalid
我也試過:Regex to match _ or end of string但給人錯誤1139
任何其他建議?
完成,謝謝你的幫助。 – trevrobwhite