我的SQL查詢有問題。Mysql與ORDER查詢UNION不起作用
此代碼用於顯示有發佈日期的文章。
例如:
BLOG ONE: day of pubblication every 16th of mounth
BLOG TWO: day of pubblication every 2nd of mounth
BLOG THREE: day of pubblication every 23th of mounth
所以今天我24日必須看到博客與出版24,25,26,27,28,1,2,3,4,5的一天....... ..........
問題是合併兩個查詢
(DAY FROM TODAY TO 31th) + (DAY FROM 1st TO YESTERDAY)
這是第一個查詢
$queryallblog = mysql_query("
(
SELECT *
FROM day,blog
WHERE day.autore = blog.titolo && day.titolo >= DAY(CURRENT_DATE())
ORDER BY day.titolo
)") or die(" Error: (" . mysql_errno() . ") " . mysql_error());
,這是第二個:
$queryallblog = mysql_query("
(
SELECT *
FROM day,blog
WHERE day.autore = blog.titolo && day.titolo < DAY(CURRENT_DATE())
ORDER BY day.titolo
)") or die(" Error: (" . mysql_errno() . ") " . mysql_error());
使用UNION語句的全球秩序是不正確的
爲什麼jquery標籤? – Jens
你在哪裏查詢Union? – Jens
向我們展示您的'UNION ALL'聲明! – jarlh