List:General Discussion« Previous MessageNext Message »
From:Jeremiah Jester Date:September 24 2013 1:10am
Subject:grouping and limiting results and rand()
View as plain text  
Hello,

How would i go about selecting 5
random cars that are flagged as internet_special (value 1) for each
dealer from a specific table?  Ive tried sub selects with no luck.
Here's a basic query that has my
required conditional. Note that I get all unique dealers by doing a
distinct(dealer_web_name). Make sense? Using mysql 5.

select dealer_web_name,id,internet_special,active from inventory where
internet_special=1 and active=1;

Appreciate the help


Jj
Thread
grouping and limiting results and rand()Jeremiah Jester24 Sep
  • Re: grouping and limiting results and rand()Peter Brawley24 Sep