Skip to content
Advertisement

Tag: datetime

SQL – count rows between dynamic number of date ranges

I have a table to store events like this: and another table to store posts like this: if I want to get count of posts that happened during a single event I can write: but how can I get the count of posts that happened during multiple events, when the target events are only known at runtime? Edit: the database

ORACLE CONVERT CHAR FORMAT “YYYY-WW” TO DATE FORMAT

I am trying to convert char date format “YYYY-WW” in ORACLE to date for calculating by week in year but have a trouble with error message format code cannot appear in date input format If i write It will be normal But if i write The message error format code cannot appear in date input format appear. I don’t have

Oracle using MOD command to set Y/N on INSERT

I’m trying to generate some sample data for the following table see below. I have functions that can generate a random DATE and timestamp within a date range, which is working fine. I want to use the MOD command to populate the active field to ‘Y’ OR ‘N’. I want to set every row to active=’Y’ except for every 5th

Advertisement