1
我有這個疑問,運作良好,這一起加入了幾個表,這都沒有問題,運作良好MYSQL加入所有表並獲得2值之間的字段記錄?
"SELECT post_info.post_id,username,profile_image_path,status_body,image_path,post_created_at FROM post_info
LEFT OUTER JOIN users_info ON post_info.user_id = users_info.user_id
LEFT OUTER JOIN status_of_post ON post_info.status_id = status_of_post.status_id
LEFT OUTER JOIN image_of_post ON post_info.image_id =image_of_post.image_id"
我想要得到的記錄(POST_ID + 1)和(POST_ID + 20) ,所以我修改它成爲這個
SELECT post_info.post_id,username,profile_image_path,status_body,image_path,post_created_at FROM post_info
LEFT OUTER JOIN users_info ON post_info.user_id = users_info.user_id
LEFT OUTER JOIN status_of_post ON post_info.status_id = status_of_post.status_id
LEFT OUTER JOIN image_of_post ON post_info.image_id =image_of_post.image_id
WHERE post_id BETWEEN (post_id + 1) AND (post_id + 20)
它陳述了這個結果。
1046 - 無數據庫中選擇
我想每次20後查詢運行的基礎上,post_id
的範圍內,是什麼做的正確方法?
你在哪裏運行你的查詢? –
我運行在phpMyAdmin – ken
確保你想運行查詢的數據庫被選中 –