sql 大概是这个样子
select booking_id from booking where concat(num, ',' , name) in ('1,name1', '2,name2', '3,name3')
用sqlalchemy 实现
_list_data = ['1,name1', '2,name2', '3,name3']
session.query(Booking.booking_id).filter(Booking.num.concat(",").concat(Booking.name).notin_(_list_data))
网友评论