CREATE TABLE Products (
ID int,
name VARCHAR(70),
price NUMBER(8,2),
primary key (ID, name)
);
drop table Instock;
/* Delete the tables if they already exist */
create table Instock (
ID int,
quantity int
);
我的数据库中有两个表。我想有两个表显示输出作为一个看起来像这样的表
ID Name Price Quantity
答案 0 :(得分:0)
SELECT A.ID,A.NAME,A.PRICE,B.QUANTITY FROM Products A,Instock B WHERE A.ID=B.ID
答案 1 :(得分:0)
你可以尝试这个来创建新表(除了将数据放在那里之外,还会创建表)
CREATE TABLE MY_TABLE as SELECT A.ID,A.NAME,A.PRICE,B.QUANTITY FROM Products A,Instock B WHERE A.ID=B.ID