0
這個查詢:SQLite的:......除了... ORDER BY RANDOM()
SELECT colour FROM ColourView EXCEPT SELECT colour FROM SkinColourExceptionsView WHERE race = 'Human' ORDER BY RANDOM() LIMIT 1
產生如下異常:1st ORDER BY term does not match any column in the result set
然而,改變ORDER BY RANDOM()
到ORDER BY colour
能夠產生結果(按顏色按字母順序排序而非隨機排列)。以下暗示ORDER BY RANDOM() LIMIT 1
應該工作:Select random row from an sqlite table。有人可以解釋爲什麼我的查詢不起作用嗎?
這兩個答案很好地工作,解釋是上衣!謝謝一堆先生。 –