score:1
Accepted answer
Use row_number() to enumerate your rows in a subquery (or CTE), and then WHERE (rownum%240)=0
. An example using a CTE:
with
original_query as (
SELECT timestamp, interest, yield FROM abc.public.table WHERE symbol='XTC' AND timestamp BETWEEN '2021-06-04 14:51:27.5127' AND '2021-06-11 14:51:27.5127' ORDER BY timestamp
),
numbered as (
select row_number() over () as rownum, oq from original_query oq
),
sampled as (
select (oq).* from numbered where (rownum%240)=0
)
select * from sampled;
Source: stackoverflow.com
Related Query
- How to return every nth row from dataset using postgresql to control a Highcharts data series
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- How to hardcode chart data in my Model then have my Controller pull it from there to display it. Using Highcharts
- How set options from HIGHCHARTS in a chart using vue chartkick
- How to display historical data and live data from database using Highcharts
- Highcharts Highstock How to Plot OHLC and Line Charts from One Set of Embedded CSV Data Using Series Map Tools?
- How to scrape data from Highcharts charts using selenium and python?
- How to replace x-axes with our own timestamp data from API in Highcharts using highstocks
- How to show unique name of every points in highCharts using angular
- Parsing JSON for use with Highcharts using jquery .parseJSON or JSON.parse: how to remove quotes from function calls for formatters?
- how to add highcharts in Datatables child row , from google sheets?
- How to query data from database using highcharts in Codeigniter?
- How to make multiple Y-axis with incoming series of data from database using Highcharts
- How to get categories from a database for highcharts using codeigniter
- How to create a column range chart in Highcharts using range and navigator functions?
- How to remove button from Highcharts
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- How can I hide series from a HighCharts legend?
- How can I hide a series from initially being displayed in Highcharts
- How do I dynamically change a data point in Highcharts using JavaScript
- How to prevent highcharts from shortening labels with ellipsis
- How can I remove the white border from HighCharts pie chart?
- Javascript Highcharts v3.0.5 - How to hide Y Axis Title when using multiple Y Axis
- Scraping data from Highcharts using selenium
- Highcharts - How to start x axis from an arbitrary value
- Highcharts how to remove headers from tooltip
- getting error#17 from highcharts while using solid gauge from backbone rails
- Loading Highcharts series from XML using jQuery
- Highcharts - How can I remove starting and ending padding from area chart
- How can I delete all of the points from a highcharts series
More Query from same tag
- Angular 2 - HighCharts implementation: Cannot find name 'HighchartsOptions'
- Highcharts title animation
- How to set different bar width in the same series Highchart
- HighStock: Tooltip ignores the localization
- HighCharts pointRange trancating width. Is this a HighCharts bug or am I missing something?
- Is it possible to dynamically add a pane in Highstock/Highchart?
- Can I add an "average" line to Highcharts Chart?
- React Highcharts with export functionality with 'react-highcharts'
- Javascript window.print() gives me a different output
- Highcharts - how to align two charts on a same line
- angular-chartJs change chart background and highlight colors
- Can I plot a diagonal plotline in highcharts?
- Highcharts Angular Error 15 despite correctly ordered values
- Highcharts/Highstock dynamically add/remove multiple series
- how to create proper json data format from mysql for highcharts
- Highcharts legend font sizes
- Date / Time problem in javascript with highcharts
- How to dynamically addEvent to Highcharts series with multiple charts?
- Highcharts having problems with Ajax Request
- Event ExportData in Highcharts
- Highstock: How can I format the xAxis crosshair label?
- Extract data series from a JSON array for a Highcharts chart with 2 y-axis
- Pie Chart is not showing correct value due to asynchronous data retrieve in Angular JS
- Using HighCharts with vb asp.net
- Plot data values inside pie charts slice
- How do I remove the pale line between events in a Highcharts columnrange chart?
- Cannot get Highcharts to show in 3D with data from mysql database
- Highcharts: Solidgauge Shadows
- highcharts legend marker and series marker with different size
- highchart bar data, borders fit to the data