I have this problem. I need to query ticket number from tickettable and member name from memberstable, with random function and distinct keyword in postgres. The MemberName should be unique.
this code works in mySQL but doesn't work in PostgreSQL.
SELECT a.ticketNum, b.memberName
FROM tickettable a, memberstable b
GROUP BY memberName
ORDER BY by rand()
LIMIT 2
What should I do?