select message.*, user.* from message, user
where message.author_id = user.user_id and (
user.user_id = ? or
user.user_id in (select whom_id from follower
where message.author_id = user.user_id and (
user.user_id = ? or
user.user_id in (select whom_id from follower
where who_id = ?))
order by message.pub_date desc limit ?
이렇게 쿼리문이 되고
? 3개에는 세션2개 args, 하고 나머지 하나 args가 들어가요
저기 저 문법에서 in이라 적혀있는 것하고 limit라는 문법이 찾아도 안보이는건지.. 제가 못찾는건지.. 알려주시면 감사하겠습니다.
이번에 파이썬도 처음하면서 flask라는 framework도 처음 독학하는데 db도 아직 배우지 않아서. 독학중입니다.
in 은 or랑 같은거고 limit은 모르게따!
굳이 in을 쓰는 이유가 뭘까요?? 괄호때문인가..
쓰는 사람 마음임 근데 쿼리쓰다보면 or 보다는 in이 더 편하긴 함
문장이 한눈에 들어온다고 해야하나 사과 or 배, 이것보단 in (사과,배)