I am trying to get a random record from a join, but I cannot get it to work! Any ideas? It’s using Microsoft Access 2003.
table = members
===============
memberID int
name varchar
table = testimonials
====================
testimonialID int
memberID int
content memo
select m.*, (SELECT t.content from testimonials t where t.memberID=m.memberID ORDER BY rnd(t.testimonialID)) as testimonialtext
FROM members m;
I basically need each member record and one random testimonial for that member. I should also add that I’ve tried it within a join too…
select m.*, t.content FROM members m
INNER JOIN testimonials t ON m.memberID=t.memberID
ORDER BY rnd(t.testimonialID)
Thanks for any help.
try to limit with TOP clause
ok, then we can do something like: