我有一个由一组队友访问的MySQL数据库。是否有任何命令可获取当前正在访问或已经访问并注销的用户的日志信息?
我必须编写一个查询,该查询返回的图书价格大于同类图书的平均价格。因此,我使用以下查询进行了此操作:
select title
from titles
where price >
(
select avg(price)
from titles
group by type
)
Run Code Online (Sandbox Code Playgroud)
但是,它将引发此错误:
subquery returned more than 1 value
Run Code Online (Sandbox Code Playgroud)
可以理解>不能用于值列表。但是我想知道解决这个问题的方法。请让我知道我需要使用的查询。DB是酒吧
titles table:
title_id , title, type, price, advance, notes, sales
Run Code Online (Sandbox Code Playgroud)
所以我需要获得价格>相似类型的平均值(价格)的标题