

if we have denials (for user 1 on feature 1) in timestamps: 1,2,24,26,27,45 and user wants to group denials that are closer to each other than 4 sec, he should get something like this: 1 (x2), 24 (x3), 45 (x1).

So we want to group the denials in report allowing the user to specify the timespan in which denials should be grouped. If we'd have one more resource, to fulfill this request, the next two denials would not happen. So usually, when the same user gets denial 3 times on the same feature in a couple seconds it is actually one denial. I want to display a list of denials, but sometimes, when the application gets denied, it retries a couple times just to make sure. UNIQUE INDEX DenialIndex (FeatureId, DateTime, UserHostId)Ī multiplicity is a number of identical requests recorded in the same second. Multiplicity MEDIUMINT UNSIGNED NOT NULL DEFAULT 1, I have a table storing information about the denied request: CREATE TABLE Denial Is there a solution, that I could use like this: SELECT Column FROM MyView(2) WHERE (.) SELECT Column FROM Table WHERE Value = GetMyVariable() īut it looks really crappy, and the usage is also crappy - I have to set the before each usage of the view. I found an ugly workaround: CREATE FUNCTION GetMyVariable() RETURNS INTEGER DETERMINISTIC NO SQLĪnd then the view is: CREATE VIEW MyView AS SELECT Column FROM Table WHERE Value = MySQL doesn't allow this. I'd like to make it more generic, it means to change 2 into a variable. SELECT Column FROM Table WHERE Value = 2

I have a view like this: CREATE VIEW MyView AS
