SELECT /* Everything from the 'notes' table */ n.id, n."createdAt", n."replyId", n."renoteId", n.text, n.name, n.cw, n."userId", n."localOnly", n."renoteCount", n."repliesCount", n.reactions, n.visibility, n.uri, n.score, n."fileIds", n."attachedFileTypes", n."visibleUserIds", n.mentions, n."mentionedRemoteUsers", n.emojis, n.tags, n."hasPoll", n."userHost", n."replyUserId", n."replyUserHost", n."renoteUserId", n."renoteUserHost", n.url, n."channelId", n."threadId", n."updatedAt", /* Everything from the 'user' table */ u.id, u."createdAt", u."updatedAt", u."lastFetchedAt", u.username, u."usernameLower", u.name, u."followersCount", u."followingCount", u."notesCount", u."avatarId", u."bannerId", u.tags, u."isSuspended", u."isSilenced", u."isLocked", u."isBot", u."isCat", u."isAdmin", u."isModerator", u.emojis, u.host, u.inbox, u."sharedInbox", u.featured, u.uri, u.token, u."isExplorable", u."followersUri", u."lastActiveDate", u."hideOnlineStatus", u."isDeleted", u."driveCapacityOverrideMb", u."movedToUri", u."alsoKnownAs", u."speakAsCat" FROM public.note n /* Join to the 'user' table */ INNER JOIN public.user u ON n."userId" = u.id /* Condition */ WHERE n."userId" = 'user_id_goes_here'