这是我的疑问:
var shouldShowEmpty = true
func viewDidLoad() {
super.viewDidLoad()
tableView.reloadData()
}
func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
shouldShowEmpty = false
tableView.reloadData()
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if shouldShowEmpty {
return 0
}
return yourArray.count
}
这些是没有SELECT
store_id as `initial`,
CONCAT(',', store_id, ',') AS store_id
FROM `mytable` AS `main_table`
WHERE (`store_id` LIKE '%,13,%');
条件的结果:
当我执行查询时,我没有得到任何结果。 where
store_id WHERE (
的相同内容LIKE '%,3,%');
和,
运算符是某种规则还是例外?
谢谢:)
答案 0 :(得分:2)
使用FIND_IN_SET解决了我的问题。更多信息: https://www.w3resource.com/mysql/string-functions/mysql-find_in_set-function.php。
归功于@Jens
SELECT
store_id as `store_id`,
FROM `ffm_nonpayment_actiontemplate` AS `main_table`
WHERE FIND_IN_SET('13', store_id);
答案 1 :(得分:0)
问题是WHERE中的字段store_id
具有初始值,而不是您使用CONCAT(',', store_id, ',') AS store_id
计算的值
如果您想要过滤,可以使用HAVING
关键字