嗯..这很愚蠢,但我已经为此奋斗了几个小时。我按照 Intellij 弹出建议错误地切换到服务工具窗口。现在我想回到正常的调试模式,但找不到方法。
无论我尝试什么,当我点击调试按钮时,它都会处理“服务”工具窗口中的所有内容,并且“调试”工具窗口被禁用,并显示“没有任何内容可显示”。
Intellij 版本 2021.1
请指教!谢谢
我正在尝试实现一个看起来像这样的简单查询:
select * from property join entity_area on property.id=entity_area.entity_id and entity_area.area_id=1 where property.price>300000 limit 12
Run Code Online (Sandbox Code Playgroud)
非常简单:我希望得到连接结果然后限制为12.
在Sequelize中我使用以下功能:
return models.property.findAll(
{
where: ["price>=?", 300000],
include: [
{
model:models.entity_area,
where: { area_id:1 }
}
],
limit:12
})
Run Code Online (Sandbox Code Playgroud)
但是这段代码会生成以下sql:
select property.*, entity_area.* from (select * from property where property.price>300000 limit 12) join entity_area on property.id=entity_area.entity_id and entity_area.area_id=1
Run Code Online (Sandbox Code Playgroud)
它与我正在尝试的逻辑完全不同,因为在生成的sql中它首先获得任何12个结果,然后尝试与entity_area连接,当然随机12个结果不一定与entity_area匹配,所以我'没有得到任何结果.
请建议我一个正确的方法.属性表非常庞大,我必须使用"限制"而不是获取所有结果并在javascript中切片.此外,我不想开始使用原始查询.