C#mysql查询子查询 [英] C# mysql query subquery
本文介绍了C#mysql查询子查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Is it possible to retrieve and insert the same image to MySql DB?
MySqlCommand cmd2 = new MySqlCommand("INSERT INTO images (Image) VALUES (Select Image from images where Image_ID='48')", con);
Image_ID is int autoincrement.
Image is BLOB;
我是什么尝试过:
我使用了几种ado技术。
What I have tried:
I used several ado techniques.
推荐答案
是的,如果你使用正确的语法:
Yes, if you use the correct syntax:
INSERT INTO images (Image) SELECT Image FROM images WHERE Image_ID = '48'
MySQL :: MySQL 5.7参考手册:: 14.2.5.1 INSERT ... SELECT语法 [ ^ ]
这篇关于C#mysql查询子查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文