代码如下: 根据deviceid查询通知消息id,当查询结果为空时会像图二报"sql: no rows in result set",正常有查询结果能返回.
需求:我要怎么改才能正常返回结果,如果为空正常返回为空,有结果直接返回结果.是dbobj.QueryRow用的不对嘛?有没有大佬指教一下Golang初学者
![微信截图_20201031111337.png](https://static.studygolang.com/201031/c07a79aae35f4a31a37855cae02335a6.png)
sys_rdbms_549 = `select event from sys_locatdev_event where deviceid = ? and fenceid = ? ORDER BY createtime DESC limit 1`
![微信截图_20201031111237.png](https://static.studygolang.com/201031/a61ede1b429576bf58d77d9c6385e278.png)