Note that there are some explanatory texts on larger screens.

plurals
  1. POSql Query for Different result
    primarykey
    data
    text
    <p>I am using mysql for database. I have to find the distinct latest result for a customer having different values for <code>ContentPrvdr</code> field. I am using following sql query:</p> <pre><code>SELECT distinct ContentPrvdr,LocalDatabaseId,Website,BusID,LastUpdated, UserCat1Rank_Local,UserCat1Count_Local,Citations,PhotoCount, VideoCount,Cat_Count FROM local_database WHERE CMCustomerID=10 ORDER BY LocalDatabaseId,LastUpdated LIMIT 0,3 </code></pre> <p>to find the result,but it will return three result having same value for <code>ContentPrvdr</code>.But i want different value results for <code>ContentPrvdr</code>. Here are the sample data for test.</p> <pre><code>LocalDatabaseId CMCustomerID FranchiseName ContentPrvdr BusName ConvBusName KeyWBizName KeyWCat Website LocationNmbr PhoneLoc StreetLoc Cat_Count Description_Local Citations PhotoCount VideoCount UserContent 41 15 2 For 1 Pizza Co bing 2 For 1 Pizza Co 2 FOR 1 PIZZA CO 2 For 1 Pizza Co, Los Angeles, CA Pizza Restaurant, Los Angeles, CA http://st1.map 1 3232699421 3480 E CESAR E CHAVEZ AVENUE 1 0 0 0 0 41 15 2 For 1 Pizza Co bing 2 For 1 Pizza Co 2 FOR 1 PIZZA CO 2 For 1 Pizza Co, Los Angeles, CA Pizza Restaurant, Los Angeles, CA NULL 1 3232699421 3480 E CESAR E CHAVEZ AVENUE 1 0 0 0 0 56 15 2 For 1 Pizza Co. Google 2 For 1 Pizza Co. 2 FOR 1 PIZZA CO 2 For 1 Pizza Co, Los Angeles, CA Pizza Restaurant, Los Angeles, CA Not Specified 1 2137494515 2528 S. FIGUEROA STREET 2 0 3 0 0 56 15 2 For 1 Pizza Co. Google 2 For 1 Pizza Co. 2 FOR 1 PIZZA CO 2 For 1 Pizza Co, Los Angeles, CA Pizza Restaurant, Los Angeles, CA Not Specified 1 2137494515 2528 S. FIGUEROA STREET 2 Fresh N Ho 23 2 1 65 15 2 For 1 Pizza Co Google 2 For 1 Pizza Co 2 FOR 1 PIZZA CO 2 For 1 Pizza Co, Los Angeles, CA Pizza Restaurant, Los Angeles, CA Not Specified 1 3232699421 3480 EAST CESAR E CHAVEZ AVENUE 1 0 0 0 0 65 15 2 For 1 Pizza Co Google 2 For 1 Pizza Co 2 FOR 1 PIZZA CO 2 For 1 Pizza Co, Los Angeles, CA Pizza Restaurant, Los Angeles, CA Not Specified 3232699421‎ 3480 EAST CESAR E CHAVEZ AVENUE 1 25 0 0 1 126 15 2 For 1 Pizza Co yellopages 2 For 1 Pizza Co 2 FOR 1 PIZZA CO 2 For 1 Pizza Co, Los Angeles, CA Pizza Restaurant, Los Angeles, CA http://www.yellow 1 5628610936 5720 IMPERIAL HWY STE Q 2 EATING PLACE 0 0 0 0 126 15 2 For 1 Pizza Co yellopages 2 For 1 Pizza Co 2 FOR 1 PIZZA CO 2 For 1 Pizza Co, Los Angeles, CA Pizza Restaurant, Los Angeles, CA http://www.yello 1 5628610936 5720 IMPERIAL HWY STE Q 2 EATING PLACE 0 0 0 0 </code></pre> <p>Please Some body help me how can i get this result with distinct <code>ContentPrvdr</code> values .</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload