SELECT a.num, a.status, a.name, b.time
FROM a inner join b on a.num = b.num
WHERE a.name = "a";
我想要将两个表(表a和表b)连接在一起。我设法运行上面的代码但是没有显示值,尽管我在表a中添加了值。
表a的示例输出:
Num Status Name
1 available a
表b:
bNum Time Num
1 9:00 1
答案 0 :(得分:0)
你可能有一些其他的名字(空间或类似) 试试
SELECT a.num, a.status, a.name, b.time
FROM a inner join b on a.num = b.num
WHERE a.name like '%a%';
或者您有num列
的强制转换问题SELECT a.num, a.status, a.name, b.time
FROM a inner join b on cast(a.num as unsigned) = cast(b.num as unsigned)
WHERE a.name like '%a%';