Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6578185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:44:18+00:00 2026-05-25T15:44:18+00:00

Using the following query to select data from a table in 15 minute intervals

  • 0

Using the following query to select data from a table in 15 minute intervals where a point has state=1:

SELECT * , ROUND( UNIX_TIMESTAMP( log_date ) / ( 15 *60 ) ) AS period
FROM  `site_node_point_states` 
WHERE state =1
AND site_node_point_id =  "11"
AND log_date
BETWEEN  '2011-09-12 13:00:00'
AND  '2011-09-12 13:00:00'
GROUP BY period
ORDER BY period ASC

This query does exactly what I want based on a single site_node_point_id, however I would like to be able to add another site_node_point_id and have that grouped by period individually of the other site_node_point_id data.

I am using PHP to make this query, and would like to try and limit it to a single query rather than looping through my current one with a different site_node_point_id.

Obviously If I were to change AND site_node_point_id = "11" to AND site_node_point_id = "11" OR site_node_point_id = "14" it would order data from both site_node_point_id 14 and 11.

Is there a solution in SQL to do the GROUP BY individually for each set of data based on the site_node_point_id that I am selecting?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:44:19+00:00Added an answer on May 25, 2026 at 3:44 pm

    Use GROUP BY site_node_point_id, period. That should group your results first by site_node_point_id, then period.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting random row from my table using the following query: SELECT value_id
Using the following query: SELECT pe.prodtree_element_name_l, MAX(rs.resource_value) AS resource_value FROM prodtree_element pe LEFT JOIN
i've been using the following query: select LEN(columnname) as columnmame from dbo.amu_datastaging This works,
The following query is given in a PL/SQL procedure . SELECT e.data FROM extra
I created a temp table in my PostgreSQL DB using the following query SELECT
I have the following query SELECT Id, Request, BookingDate, BookingId FROM Table ORDER BY
I'm using the following mysql query to return some data from my database. Currently
I'm using the following code to get some data from a table. $collection =
I am using following query which works fine for me except one problem SELECT
I have a SqlDependency set up using the following query: string sql = "SELECT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.