我的披萨 table 脚本是:
use sys;
create table pizzas (
name varchar(50),
toppings varchar(50),
price float);
insert into pizzas (name, toppings, price) values ('margarita', 'cheese, tomato', 5.0);
insert into pizzas (name, toppings, price) values ('hawaiian', 'cheese, tomato, ham, pineapple', 5.5 );
insert into pizzas (name, toppings, price) values ('hot veggie', 'cheese, tomato, chilli, onion', 5.5 );
我正在尝试创建一个查询以确定哪些比萨饼包含奶酪..
我试过的是:
选择披萨 从 浇头 在哪里 toppings="$奶酪$";
但是没用
最佳答案
SELECT name FROM pizzas WHERE toppings LIKE '%cheese%'
应该可以解决问题。
关于mysql - 简单的 SQL 查询工作台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33323077/