chuanmoweixi 2021-05-15 11:28 采纳率: 0%
浏览 171

[Err] 1064 - You have an error in your SQL syntax?

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create table Goods
(
   goods_id             int not null auto_increment,
   ' at line 3
[Err] select * from user ;

select * from user where user_name='xiaoming' and user_pass='pass1'

create table Goods
(
   goods_id             int not null auto_increment,
   brand_id             int,
   goods_name           text,
   is_special           varchar(10),
   goods_price          decimal(10,2),
   goods_off_price      decimal(10,2),
   goods_description    text,
   goods_image_path     text,
   primary key (goods_id)
);

insert into brand(brand_name) values('IPhone'),('Samsung'),('Mi'),('Nokia') ;

select * from brand ;

insert into goods(brand_id,goods_name,is_special,goods_price,goods_off_price,
goods_description,goods_image_path)
values(1,'IPhone 5','true',1000,800,'IPhone 5','/images/iphone.png'),
(2,'galaxy-note','true',1200,900,'galaxy-note','/images/galaxy-note.jpg'),
(3,'Mi Mix','false',1500,1000,'Mi Mix','/images/Z1.png'),
(4,'Nokia 9','false',1300,1000,'Nokia 9','/images/galaxy-s4.jpg');

select * from goods ;

select * from cart ;

select last_insert_id() ; 

select * from cart where user_id=3;

select * from cart_goods 

select g.*,cg.goods_qty  from cart_goods cg,goods g 
 where cart_id=(select cart_id from cart where user_id=3) )
[Msg] Finished - Unsuccessfully
--------------------------------------------------

  • 写回答

4条回答 默认 最新

  • CSDN专家-sinJack 2021-05-15 11:33
    关注

    sql语法有错误,你不要一次性执行这么多。分多次执行

    评论

报告相同问题?

悬赏问题

  • ¥15 VFP如何使用阿里TTS实现文字转语音?
  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题