使用Join时Find函数里面的条件并没有加入到sql语句中 #1009
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1009
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题:
DbEngine.Join("INNER", "device_app", "device.sn=device_app.sn").
Join("INNER", "app", "app.id=device_app.app_id").
Desc("app.id").Limit(limit, start).Find(&devs, orm.Device{Sn: req.Sn})
打印出来的语句:
SELECT * FROM device INNER JOIN device_app ON device.sn=device_app.sn INNER JOIN app ON app.id=device_app.app_id ORDER BY app.id DESC LIMIT 1 OFFSET 1
@willkk could you confirm that
req.Sn
is not blank?req.Sn is not empty. I check req.Sn before using it.