insert into A (col1, col2, col3)
select col1, col 2 from B where ...
union all
select col3, '' from C where..
--
#10
insert into A (col1, col2, col3)
select col1, col 2 from B where ...
union all
select col3, '' from C where..
--
额你这个是指col3后面接一个逗号和一个单引号吗?
然而还是不行,Column count doesn't match value count at row 1
#11
额你这个是指col3后面接一个逗号和一个单引号吗?
然而还是不行,Column count doesn't match value count at row 1
你把的完整语句贴上来,我给你改一下;
#12
额你这个是指col3后面接一个逗号和一个单引号吗?
然而还是不行,Column count doesn't match value count at row 1
你把的完整语句贴上来,我给你改一下;
insert into task (typeid, list, userid)
select typeid, list from pics where url = './...'
union all
select userid from user where username = 'jhgfkdj'
#13
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
#14
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
还是不行,还是说The used SELECT statements have a different number of columns
#15
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
还是不行,还是说The used SELECT statements have a different number of columns
不会的,贴一下你的三张表的建表语句;最好再给一些测试数据;
#16
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
上面的错误是我忘了在第二行中加入''导致,现在在第二行中加入''还是有错误Incorrect integer value: '' for column 'userid' at row 1
这个是因为我的userid是自增的原因吗?
#17
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
还是不行,还是说The used SELECT statements have a different number of columns
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
还是不行,还是说The used SELECT statements have a different number of columns
不会的,贴一下你的三张表的建表语句;最好再给一些测试数据;
大大,真心还是要继续请教你啊,我试了很多个办法都无用……
这是我phpmyadmin中的数据表结构
#19
看来是个纯新手。。
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
单独执行这个查询,看看是什么提示?
#20
看来是个纯新手。。
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
单独执行这个查询,看看是什么提示?
#21
看来是个纯新手。。
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
搞定了!谢谢大神!
insert into task (typeid, list, userid)
select pics.typeid, pics.list, user.userid
from pics, user
where pics.url = './...'
and user.username = 'jhgfkdj'
#35
就是我的那个excel中,如何将我后两张表特定的行的字段值插入到第一张task表中相同字段中?
insert into task (typeid, list, userid)
select p.typeid, p.list, u.userid
from pics p, userid u
where p.userid = b.text and ..
insert into A (col1, col2, col3)
select col1, col 2 from B where ...
union all
select col3, '' from C where..
--
#10
insert into A (col1, col2, col3)
select col1, col 2 from B where ...
union all
select col3, '' from C where..
--
额你这个是指col3后面接一个逗号和一个单引号吗?
然而还是不行,Column count doesn't match value count at row 1
#11
额你这个是指col3后面接一个逗号和一个单引号吗?
然而还是不行,Column count doesn't match value count at row 1
你把的完整语句贴上来,我给你改一下;
#12
额你这个是指col3后面接一个逗号和一个单引号吗?
然而还是不行,Column count doesn't match value count at row 1
你把的完整语句贴上来,我给你改一下;
insert into task (typeid, list, userid)
select typeid, list from pics where url = './...'
union all
select userid from user where username = 'jhgfkdj'
#13
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
#14
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
还是不行,还是说The used SELECT statements have a different number of columns
#15
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
还是不行,还是说The used SELECT statements have a different number of columns
不会的,贴一下你的三张表的建表语句;最好再给一些测试数据;
#16
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
上面的错误是我忘了在第二行中加入''导致,现在在第二行中加入''还是有错误Incorrect integer value: '' for column 'userid' at row 1
这个是因为我的userid是自增的原因吗?
#17
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
还是不行,还是说The used SELECT statements have a different number of columns
insert into task (typeid, list, userid)
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
还是不行,还是说The used SELECT statements have a different number of columns
不会的,贴一下你的三张表的建表语句;最好再给一些测试数据;
大大,真心还是要继续请教你啊,我试了很多个办法都无用……
这是我phpmyadmin中的数据表结构
#19
看来是个纯新手。。
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
单独执行这个查询,看看是什么提示?
#20
看来是个纯新手。。
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
单独执行这个查询,看看是什么提示?
#21
看来是个纯新手。。
select typeid, list, '' from pics where url = './...'
union all
select '','', userid from user where username = 'jhgfkdj'
搞定了!谢谢大神!
insert into task (typeid, list, userid)
select pics.typeid, pics.list, user.userid
from pics, user
where pics.url = './...'
and user.username = 'jhgfkdj'
#35
就是我的那个excel中,如何将我后两张表特定的行的字段值插入到第一张task表中相同字段中?
insert into task (typeid, list, userid)
select p.typeid, p.list, u.userid
from pics p, userid u
where p.userid = b.text and ..