2
我已經嘗試了所有,有沒有其他的語法,將工作?我有以下它是聯盟,還是或?
SELECT `ID` , `Home_Team`
FROM `FixturesDates` where `ID` =
(SELECT `ID`
FROM `FixturesDates`
WHERE `Home_Team`
REGEXP 'saturday|sunday|monday|tuesday|wednesday|thursday|friday'
order by ID asc LIMIT 1)
這個作品,
我也有
SELECT `ID` , `Home_Team`
FROM `FixturesDates`
where `ID` =
(SELECT `ID` FROM `FixturesDates` WHERE `Home_Team`
REGEXP 'saturday|sunday|monday|tuesday|wednesday|thursday|friday'
order by ID asc LIMIT 1,1)
這也適用,但即時通訊無法將2相結合,試圖
SELECT `ID` , `Home_Team`
FROM `FixturesDates`
where `ID` =
(SELECT `ID` FROM `FixturesDates` WHERE `Home_Team`
REGEXP 'saturday|sunday|monday|tuesday|wednesday|thursday|friday'
order by ID asc LIMIT 1)
UNION
(SELECT `ID` FROM `FixturesDates` WHERE `Home_Team`
REGEXP 'saturday|sunday|monday|tuesday|wednesday|thursday|friday'
order by ID asc LIMIT 1,1)
但這不起作用,AND和OR也不起作用。有什麼其他的嗎?
謝謝
第一個應該工作作爲列不爲空,可以看到單獨運行查詢的第二部分,所以我不知道它爲什麼說NULL,但是你發佈的最後一個查詢是完美的。謝謝 – Mike 2013-04-27 17:07:05
@Mike。 。 。我現在意識到你打算在'where'子句中做'union'。爲此,您需要一組額外的parens:'((select ...)union(select ...))'中的id。 'union'適用於整個查詢。 – 2013-04-27 17:19:13
完美,謝謝。 – Mike 2013-04-27 17:47:10