有mysql代码的问题不断收到错误1064

时间:2017-03-30 06:20:32

标签: mysql

这是我的代码,我得到SELECT * FROM judge的错误;

CREATE VIEW judge_vw AS(

  SELECT *FROM judge;
  WHERE suburb='adelaide';
  order by 'judge_id';`enter code here`
  with check option;

insert into judge_vw values(',judge_id 6','schofield','adelaide,')

update judge_vw set name='russell'where names='jones'

delete from judge_vw where judge_id=7;

drop view if exists judge_vw
);

2 个答案:

答案 0 :(得分:0)

你的罪孽是错的,只留下最后;在命令结束时删除所有其他人 不要使用引号作为列名(例如:judge_id),remve unuseful(和chcek

CREATE VIEW judge_vw AS 
SELECT * FROM judge
WHERE suburb='adelaide'
ORDER BY judge_id;

你插入似乎包含错误的逗号

insert into judge_vw values('judge_id 6','schofield','adelaide');

答案 1 :(得分:0)

删除不必要的半号

CREATE VIEW judge_vw AS
      SELECT *FROM judge
      WHERE suburb='adelaide'
      order by judge_id;


    insert into judge_vw values('judge_id 6','schofield','adelaide');

    update judge_vw set name='russell'where names='jones';

    delete from judge_vw where judge_id=7;

    drop view if exists judge_vw;