SELECT id
FROM (
SELECT *
FROM ty_hotel_product
WHERE parent_product_id > 0 ORDER BY parent_product_id DESC
) realname_sorted, (
SELECT @pv := 2
) initialisation
WHERE FIND_IN_SET(parent_product_id, @pv) > 0
AND (@pv := concat(@pv, ',', id))
select id from (
select t1.id,
if(find_in_set(parent_product_id, @pids) > 0, @pids := concat(@pids, ',', id), 0) as ischild
from (
select id,parent_product_id from ty_hotel_product t where t.status = 1 order by parent_product_id, id
) t1,
(select @pids := 1) t2
) t3 where ischild != 0
查询mysql 某个表下一个自增id mysql查询所有下级
转载文章标签 查询mysql 某个表下一个自增id 文章分类 MySQL 数据库
-
MySQL设置表自增步长
MySQL设置表自增步长的方法示例。
自增 MySQL sql -
FFmpegFrameRecorder占内存
这个问题可以说是 Java 面试的高频面试题了,有很多面试官都喜欢问这个问题,问题可能是下面这样的。线上一台服务器 CPU 使用率100% 了,如果你碰到这样的情况,如何排查并找到问题原因?这就是一个套路题,所谓套路题就是有标准的套路解法的,掌握了套路,不仅能解决面试官,还能解决问题。不然真的就掉进套路里了。当我们真碰到这个问题的时候应该怎么排查呢?模拟一个高 CPU 场景先用一段程序创建几个线程
ffmpeg占用cpu过高 idea占用cpu过高 java cpu过高排查 java 进制转换 java要cpu