Query to Get Count Value based on Time Interval

I have table just like this :

I have table just like this :

  • t_id ======> id ticket
  • t_open_by ======> name that raise the ticket
  • t_closed_by ======> name that closed the ticket
  • t_open_time ======> open ticket time
  • t_closed_time ======> closed ticket time

    How should i do, if i want to show the Count all tickets that closed by name, and closed time today, weekly, monthly and yearly ? Just like this :

        Name                today      weekly     monthly     yearly
    [email protected] 2 10 70 1000
    [email protected] 5 14 60 1234

    Sample data :

    t_id      t_open_by      t_closed_by       t_open_time        t_closed_time
    1 [email protected] [email protected] 2018-03-28 2018-03-29
    2 [email protected] [email protected] 2018-04-28 2018-05-29

    Need Help guys... Thanks

MySQL Database Bootcamp: Go from SQL Beginner to Expert | Simpliv

MySQL Database Bootcamp: Go from SQL Beginner to Expert | Simpliv

MySQL Database Bootcamp: Go from SQL Beginner to Expert

This course will help you in reading and writing complex SQL queries using one of the most demanding database in industry which is mysql. These skills are also applicable to any other major SQL database like Microsoft SQL Server,Oracle, and much more.

This course is designed for Students as well Software professionals who are willing to learn, understand the technique to create databases, tables or how to query that database.This course includes Creating database, different ways to insert values in the database as well as selecting queries and different types of joins.

Each section includes practice problems or additional e-books to help reinforce what you learn in the video tutorials.

If you are already a SQL programmer and looking for a reference course then this course is not for you.

Basic knowledge
No prior SQL or technical experience is required.
No software License is required. We will install MySQL and workbench which is freely available on site
A Windows or Mac machine where we will install the database and practice our queries
Basic computer knowledge is required to learn from this course
What will you learn
Create your own database or insert values in existing databases
Write Advance SQL queries
Become a proficient MySQL Workbench user(Create, import, export and query databases)
Handle complex SQL joins(inner,Outer,Cross & Self)
Student will be able to Create & modify tables with setting constraints to columns.
Learn some of the most useful built-in functions in SQL
To continue:

SQL Full Course - SQL Tutorial For Beginners - MySQL Essentials - SQL Training

SQL Full Course - SQL Tutorial For Beginners - MySQL Essentials - SQL Training

This SQL Full Course video will cover all the topics of SQL starting from scratch. This video is great for beginners who want to learn SQL and for advanced people to brush up their skills.

Thanks for watching

If you liked this post, share it with all of your programming buddies!

Follow us on Facebook | Twitter

Learn More

The Complete SQL Bootcamp

The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert

The Complete Oracle SQL Certification Course

MySQL Databases With Python Tutorial

SQL vs NoSQL or MySQL vs MongoDB

MySQL Database Tutorial for Beginners to Advanced Part 1/2

An Introduction to Queries in MySQL

How To Troubleshoot MySQL Queries?

SQL with MySQL - Complete Tutorial for Beginners

Build a Basic CRUD App with PHP and MySQL

Learn to Build SQL Query| Ultimate SQL and DataBase Concepts|Simpliv

Learn to Build SQL Query| Ultimate SQL and DataBase Concepts|Simpliv

Learn to Build SQL Query| Ultimate SQL and DataBase Concepts

SQL developers are earning higher salary in IT industry, but, its not about writing queries its about understanding and applying the right query at right time and this course will let you understand complex SQL Statements in an easy way .

Moreover, This Course will teach you how to extract Data from Database and write complex queries to a database This course will focus on a wider scale by Covering Structure Query Language SQL concepts as a whole, whether Students work with MySQL, Microsoft SQL Server, Oracle Server, etc.

This course have 5 Chapters in which you will learn

Chapter 1 Fundamentals

Building Blocks
Selecting Records from DB
Working with Arithmetic Expressions
Chapter 2 Conditioning Sorting and Operators

Logical Operators
Comparison Operators
Operator Precedence
Sorting Results
Chapter 3 Functions

Character Functions
Number Functions
Date Functions
General Purpose Functions
Nesting Functions
Chapter 4 Grouping

Multiple Row Functions on a single Table
Multiple Row Functions on Many Table
Chapter 5 Joins

Understanding Primary Key
Understanding Foreign Key
Understanding Need of Joins
Cartesian Product
Equie Join Simple Join Self Join
Non Equie Join
Outer Join
Self Join
Course is Designed for College and University Students who want Solid SQL and Data Base Concepts in a short period of time.

Who this course is for:

University or College students
Anyone who wants Solid SQL Concepts
Basic knowledge
No prior knowledge is required
What will you learn
SQL Fundamentals
Understand Complex SQL Concepts in Easy way using daily life examples
Construct SQL Statements
Use SQL to retrieve data from database
Selecting Data From Database
Restricting and Sorting Data from DB
Grouping Data From DB
Construct SQL statements that will let them work with more than two tables
Use SQL Functions
Work with SQL Operators and find out precedence
Nesting in SQL
To continue: