JetibenRong

JetibenRong

我想有那么一段时光,可以在面朝大海的房车里煮上一杯咖啡,看看曾写过的代码

其他网站内容复制到J5的SQL语句

本文发布于:2024-07-02

1、如何把织梦的两个表dede_addonarticle,dede_archives,标题、缩略图、内容和时间对应放在一个表里,

INSERT INTO combined_content_details (id, title, thumbnail, content, category_id, post_time)
SELECT 
    arc.aid AS id, 
    arc.title AS title, 
    arc.litpic AS thumbnail, 
    addon.body AS content, 
    arc.typeid AS category_id, 
    arc.senddate AS post_time
FROM 
    dede_addonarticle AS addon
JOIN 
    dede_archives AS arc ON addon.aid = arc.aid;

2、如何把织梦数据库表里面的时间字段post_time的内容,改成正常的时间呢

SELECT 
    id, 
    title, 
    FROM_UNIXTIME(post_time, '%Y-%m-%d %H:%i:%S') AS formatted_time 
FROM 
    dede_archives;

3、把combined_content_details内容的几个字段复制到到news的某个类别去。

INSERT INTO news (title, image, content, time, category, published)
SELECT title, image, content, time, 29,1
FROM combined_content_details
WHERE category = 194;

4、

我想把表名称为product_show,image字段内容,如果内容不是空的,
前面加上{"uploadid":0,"fileurl":"
后面加上"}

UPDATE product_technology
SET image = CONCAT('{"uploadid":0,"fileurl":"', image, '"}') 
WHERE image IS NOT NULL AND image != '';
JetibenRong

JetibenRong

我想有那么一段时光,可以在面朝大海的房车里煮上一杯咖啡,看看曾写过的代码

联络

标签

链接