首页 > 解决方案 > 如何在数据库中使用临时表 slug?

问题描述

此查询不起作用

SELECT word_name, word_id from words where REPLACE(slug, '-', ' ') like '%word%' AND 1=1 ORDER BY length(word_name) ASC LIMIT 8

PS 编辑:对不起,我放弃了这个问题。请忽略这个问题。

标签: codeigniter

解决方案


不确定您是否需要所有这些步骤。例如,您可以在一个语句中检查存在、定义和全选

drop table if exists t;
create temporary table if not exists t 
(id int)
select id from users;

推荐阅读