sql怎么在一张表里查到数据,然后把数据倒序到另一张表里查询

from CmsVideoExt where poststatus = 1 and videoId in(select entityId from MeAppLearnlog where userId =:userId and kind =:kind)order by videoId desc

我想先在MeAppLearnlog 表里的根据userId、kind获得entityId并按照时间time倒序输出,然后在根据entityId到CmsVideoExt 表里面查,该怎样改?

select * insert b from a

or

insert into b (select * from a)

id一般都是自增长字段.
你插入时候不插ID值

insert into b (除了id值的字段,用逗号隔开,这个括号要的) (select 除了id字段的其他字段,用逗号隔开 from a)
温馨提示:答案为网友推荐,仅供参考
相似回答