Select items from various sources, and order by date

前端 未结 1 653
抹茶落季
抹茶落季 2021-01-29 08:12

I would like to achieve the followings but is having difficulties: 1) Select an item from either one of two query (item_title, or item__keywords), in the sense that when the use

相关标签:
1条回答
  • 2021-01-29 08:35

    OR separates whole clauses, not 2 fields. Try this instead:

    SELECT * 
        FROM items 
        WHERE item_title LIKE '%search_query%' 
            OR item_keywords LIKE '%search_query%' 
        ORDER BY course_date
    
    0 讨论(0)
提交回复
热议问题