dkilby
asked on
MS SQL + Percentage from List - Random
I am trying to create a view from a table where the view is a percentage and random.
So the view always has 38% of the list in the table
ie: select 38% of table where submitdate between '08/01/2015' and '08/30/2015' and CustomerScore < 7
But i want the 38% to be stored in another table so that value can adjust from month to month.
So the view always has 38% of the list in the table
ie: select 38% of table where submitdate between '08/01/2015' and '08/30/2015' and CustomerScore < 7
But i want the 38% to be stored in another table so that value can adjust from month to month.
ASKER
I want to pull back 38% of the rows that meet the criteria of
where submitdate between '08/01/2015' and '08/30/2015' and CustomerScore < 7
and the questions is this possible and if so how would the query look ?
thanks
where submitdate between '08/01/2015' and '08/30/2015' and CustomerScore < 7
and the questions is this possible and if so how would the query look ?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
Somewhat pedantic perhaps, sorry, but there is no actual question, just a series of statements.
I suspect you will need a function, not a view, for this.
& are you also expecting these to be flexible?
where submitdate between '08/01/2015' and '08/30/2015' and CustomerScore < 7
are these the only likely filtering conditions?
{+ edit}
oh, and can you expend on what you mean by random?
for example, do you mean, that the 38% any be any percentage (0 to 100)
or, do you mean, the rows returned to meet the 38% are randomly chosen