Data visualization on a web app

114 views Asked by At

I have a data that should be presented as a flexible table.

For example, this is how I save the data on my mysql server:

Column 1    | Column 2| Column 3| Column 4|Column 6|
------------|---------|---------|---------|--------|
UniqueValue1| value   | value 1 |   aaa   |    1   |
UniqueValue2| value   | value 1 |   bbb   |    2   |
UniqueValue3| value   | value 3 |   ccc   |    3   |
UniqueValue4| value   | value 2 |   ddd   |    4   |

Now, I want to present it on a web site with the ability to query this database. For example

  1. Querying all the data where you find the "value 1" on column 3 and group it by column 3. The result will be

    example

  2. Querying all the data where column 5 is bigger than 2 and group it by column 3 The result will be:

    example

1

There are 1 answers

0
Vishal On

Please find below 2 queries for your questions.

1. SELECT column3,column1,column2,column4,column5 FROM <table_name> WHERE column3 = "value 1" GROUP BY column3,column1;

2. SELECT  column3,column1,column2,column4,column5 FROM <table_name> WHERE column5 > 2 GROUP BY column3,column1;