SELECT depreciate.id, depreciate.item_id, depreciate.batch_code,
         new_item.description, depreciate.life_time, depreciate.scrap_value,
         depreciate.dep_type, item.po_number, item.purchase_value,
         item.current_value, item.purchase_date, depreciate.annual_depreciation,
         depreciate.depreciation_rate, depreciate.total_depreciate,
         depreciate.location, depreciate.dis_id 
    FROM depreciate, item, new_item 
   WHERE depreciate.item_id=item.item_id
     AND depreciate.item_id=new_item.id
     AND new_item.data_mining=1
     AND DATE_FORMAT('item.purchase_date', '%m %d') LIKE '%09-18%'

Please if someone can tell me the error of this code ? I'm new to this.

请谁能告诉我这段代码的错误?我是新手。

2 个解决方案

#1


3

Try changing

试着改变

AND DATE_FORMAT('item.purchase_date', '%m %d') LIKE '%09-18%'

to

HAVING DATE_FORMAT(`item`.`purchase_date`, '%m %d') LIKE '%09-18%'

更多相关文章

  1. 错误1452:无法添加或更新子行:外键约束失败
  2. Oracle相当于MySQL代码“插入虚拟”以返回错误消息
  3. MySQL添加外键错误1215
  4. 在SQL中声明@变量返回错误
  5. Linux第二篇----使用rpm方法安装MySQL(含各种出现的错误和排错)
  6. MySQL查询中的变量会导致错误
  7. mysql主从同步报slave_sql_running:no的解决方案
  8. mysql编译安装后各种常见错误集锦
  9. org.json Android系统错误。JSONException:在字符0处输入结束

随机推荐

  1. 构造模式实践
  2. 原理暂且不谈,定时器你当真会用?
  3. 编码不规范,同事真的会两行泪?
  4. 面试官问我,SpringApplication.run做了哪
  5. 自学第四十八天
  6. 谁在关心toString的性能?
  7. Monadic Function_Haskell笔记12
  8. 从JDK中,我们能学到哪些设计模式?
  9. 为什么这段代码输出的是 ”Hello World”
  10. 10 行 Java 代码实现最近被使用(LRU)缓存