Hi everybody,
I have two tables storing members data
members: id, field1, field2 and field3...
members_extra: memberId, someExtraField1 and someExtraField2
members_extra.memberId is a Foreign Key referencing members.id
'members_extra' may or may not have related rows for rows in 'members'
let's say: I have 1000 members in 'members', and I have 50 rows in 'members_extra' containing extra info
now I want to search 'members' and order the results according to 'member.field2'... but I want members who have extra info (in members_extra) to be listed before those who don't have extra info
now I use member.field3 as ENUM('true','false') which indicates whether this member has extra info or not and ordering like this: ORDER BY field3 ASC, field2 ASC... this works fine, but I don't like the approach, since I have to update members.field3 every time I insert or delete something from members_extra
how to do this without using members.field3?
thank you