Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 14291

Is it possible to randomly output query

$
0
0

It is a website with about 400 affiliates, on one page people can see recent updates. Certain affiliates modify on purpose often small things on their website in order to end up high on this list. therefore we find always the same couple of affiliates on top of the list. Is it possible to randomly output the query that gets the most recent updates to give everybody equal chances?

I realise that in the query there is a ORDER BY clause that orders by most recent date. What I need is the 40 most recent updates and output them randomly.

 

<cfquery name="lastupdates" datasource="#request.dbc#">
        SELECT
            handelaaruuid
            , projectID, naam
            , websiteurl
            , gemeente
            , animatie
            , type_adverteerder
            , categoryid
            , subcatid,
             datum_voorlaatste_aanpassing AS datum
             , CONVERT(nvarchar, datum_voorlaatste_aanpassing, 106) AS datum2
        FROM      LastUpdates
        WHERE     (projectID = 1)
        ORDER BY datum desc
    </cfquery>


Viewing all articles
Browse latest Browse all 14291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>