gpt4 book ai didi

sql - 像命令不工作 Oracle SQL

转载 作者:搜寻专家 更新时间:2023-10-30 22:10:05 25 4
gpt4 key购买 nike

我是数据库和 PHP 的新手。在我的代码中,我试图从 PHP 脚本中创建一个表,这就是我所拥有的。

create table booktable(BookID INT PRIMARY KEY,
BookName VARCHAR(100),
Published DATE,
Price NUMBER(18,2),
Author1 VARCHAR2(30),
Author2 VARCHAR2(30));

INSERT INTO booktable (BookID, BookName, Published, Price, Author1, Author2)
VALUES (1, 'Fundamentals of Digital Logic with VHDL Design','14-APR-08', 190.25,'Stephen Brown','Zvon Ko G.Vranesic');
INSERT INTO booktable (BookID, BookName, Published, Price, Author1, Author2)
VALUES (2, 'Distributed Systems Principles and Paradigm','26-JUL-13', 197.80,'Andrew S. Tanenbaum','Maarten Van Steen');
INSERT INTO booktable (BookID, BookName, Published, Price, Author1, Author2)
VALUES (3, 'Eat Real Food The Only Solution to Permanent weight Loss and Disease Prevention','1-APR-15', 29.99,'David Gillespie','');
INSERT INTO booktable (BookID, BookName, Published, Price, Author1, Author2)
VALUES (4, 'Introduction to Computational Science Modeling and Simulation for the sciences','2-MAY-06', 132.75,'Angela B.Shiflet','George W. Shiflet');
INSERT INTO booktable (BookID, BookName, Published, Price, Author1, Author2)
VALUES (5, 'Live Well on Less A Practical Guide to Running a Lean Household','27-MAY-15', 19.00,'Jody Allen','');
INSERT INTO booktable (BookID, BookName, Published, Price, Author1, Author2)
VALUES (6, 'Middle School: Just My Rotten Luck','1-JUL-15', 15.99,'James Patterson','');
INSERT INTO booktable (BookID, BookName, Published, Price, Author1, Author2)
VALUES (7, 'Clementine Rose and the Birthday Emergency','1-JUL-15', 12.99,'Jacqueline Harvey','');
INSERT INTO booktable (BookID, BookName, Published, Price, Author1, Author2)
VALUES (8, 'My Life It''s a long story','26-MAY-15', 32.99,'Willie Nelson','');
INSERT INTO booktable (BookID, BookName, Published, Price, Author1, Author2)
VALUES (9, 'Sword of Summer Magnus Chase','7-OCT-15', 15.99,'Rick Riordan','');

表创建成功,但是当我尝试运行查询时

`SQL> select * 
from booktable
where bookname like '%my%';`

它说没有选择行。我不知道我哪里做错了。谢谢。

最佳答案

@alfasin 是对的。您也可以降低以实现您想要做的事情

select * from booktable where lower(bookname) like '%my%';

关于sql - 像命令不工作 Oracle SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32918346/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com