Can somebody help me with this query? I don't have deep knowledge in SQL. What does these two lines mean in query?
HIT_DAY = TO_DATE(%(date)s,'MM-DD-YYYY')
ss.weblab_name = %(experiment)s
Is date and experiment some kind of parameters that I should pass into query? Why they ending with "s" ? How to pass this parameters?
This is whole query:
SELECT
session_count,
treatment
FROM
SESSIONS ss
WHERE
HIT_DAY = TO_DATE(%(date)s,'MM-DD-YYYY')
AND
ss.weblab_name = %(experiment)s
GROUP BY
ss.treatment_name
;
Some SQL IDE's such as Datagrip and Redash use those type of things to indicate that a user parameter could be entered. see https://www.jetbrains.com/help/datagrip/user-parameters.html http://help.redash.io/article/44-query-parameters
Some applications use that kind of format to indicate where data should be put when dynamically creating a query (so that would be a query template)
It is likely that they will be just string substitution so %(experiment) may resolve to widget but the column name might be widgets. or there may be something else but it will be dependent entirely on the application that is using these. Not Redshift.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With