t-sql - 求大侠帮忙把SQLServer的脚本翻译成MySQL可用的. 谢谢了
PHP中文网
PHP中文网 2017-04-17 13:27:21
0
0
605

SQL(MSSQL)脚本代码:

IF (SELECT parentId FROM t_category WHERE categoryId = 1) IS NULL
    UPDATE t_category SET sort = sort + 1
        WHERE sort >= (SELECT sort FROM t_category WHERE categoryId = 1)
            AND parentId IS NULL
ELSE
    UPDATE t_category SET sort = sort + 1
        WHERE sort >= (SELECT sort FROM t_category WHERE categoryId = 1)
            AND parentId = (SELECT parentId FROM t_category WHERE categoryId = 1)

小弟初次接触mysql, 很多与sqlserver的差异都还不太明白, 谢谢大侠们了!

PHP中文网
PHP中文网

认证高级PHP讲师

Antworte allen(0)
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage