Skip to main content
edited title
Link
cjv
  • 49
  • 1
  • 2
  • 12

Cross Grid Crosstab View in mySQL?

additional information
Source Link
cjv
  • 49
  • 1
  • 2
  • 12

I dont know I titled this correct, but let me explain what i am looking for.

I have two tables.

Clients

clID (primary key) ClName (varchar) 

Scores

ID (Primay key) clID (F Key) PlayDate (Date/Time) Score (double) 

Client table data looks like this

clID clName 1 Chris 2 Gale 3 Donna 

Scores table data looks like this

ID clID PlayDate Score 1 2 23/01/2012 -0.0125 2 2 24/01/2012 0.1011 3 3 24/01/2012 0.0002 4 3 26/01/2012 -0.0056 5 3 27/01/2012 0.0001 6 1 12/01/2012 0.0122 7 1 13/01/2012 0.0053 

Is it possible to create a view that will look like this

Date Chris Gale Donna 12/01/2012 0.0122 - - 13/01/2012 0.0053 - - 23/01/2012 - -0.0125 - 24/01/2012 - 0.1011 0.0002 26/01/2012 - - -0.0056 27/01/2012 - - 0.0001 

If later there is a another new client then i should be able to check the data for that new client in the new column that will be now created in this view.

Thanks in advance.

I dont know I titled this correct, but let me explain what i am looking for.

I have two tables.

Clients

clID (primary key) ClName (varchar) 

Scores

ID (Primay key) clID (F Key) PlayDate (Date/Time) Score (double) 

Client table data looks like this

clID clName 1 Chris 2 Gale 3 Donna 

Scores table data looks like this

ID clID PlayDate Score 1 2 23/01/2012 -0.0125 2 2 24/01/2012 0.1011 3 3 24/01/2012 0.0002 4 3 26/01/2012 -0.0056 5 3 27/01/2012 0.0001 6 1 12/01/2012 0.0122 7 1 13/01/2012 0.0053 

Is it possible to create a view that will look like this

Date Chris Gale Donna 12/01/2012 0.0122 - - 13/01/2012 0.0053 - - 23/01/2012 - -0.0125 - 24/01/2012 - 0.1011 0.0002 26/01/2012 - - -0.0056 27/01/2012 - - 0.0001 

Thanks in advance.

I dont know I titled this correct, but let me explain what i am looking for.

I have two tables.

Clients

clID (primary key) ClName (varchar) 

Scores

ID (Primay key) clID (F Key) PlayDate (Date/Time) Score (double) 

Client table data looks like this

clID clName 1 Chris 2 Gale 3 Donna 

Scores table data looks like this

ID clID PlayDate Score 1 2 23/01/2012 -0.0125 2 2 24/01/2012 0.1011 3 3 24/01/2012 0.0002 4 3 26/01/2012 -0.0056 5 3 27/01/2012 0.0001 6 1 12/01/2012 0.0122 7 1 13/01/2012 0.0053 

Is it possible to create a view that will look like this

Date Chris Gale Donna 12/01/2012 0.0122 - - 13/01/2012 0.0053 - - 23/01/2012 - -0.0125 - 24/01/2012 - 0.1011 0.0002 26/01/2012 - - -0.0056 27/01/2012 - - 0.0001 

If later there is a another new client then i should be able to check the data for that new client in the new column that will be now created in this view.

Thanks in advance.

Source Link
cjv
  • 49
  • 1
  • 2
  • 12

Cross Grid View in mySQL

I dont know I titled this correct, but let me explain what i am looking for.

I have two tables.

Clients

clID (primary key) ClName (varchar) 

Scores

ID (Primay key) clID (F Key) PlayDate (Date/Time) Score (double) 

Client table data looks like this

clID clName 1 Chris 2 Gale 3 Donna 

Scores table data looks like this

ID clID PlayDate Score 1 2 23/01/2012 -0.0125 2 2 24/01/2012 0.1011 3 3 24/01/2012 0.0002 4 3 26/01/2012 -0.0056 5 3 27/01/2012 0.0001 6 1 12/01/2012 0.0122 7 1 13/01/2012 0.0053 

Is it possible to create a view that will look like this

Date Chris Gale Donna 12/01/2012 0.0122 - - 13/01/2012 0.0053 - - 23/01/2012 - -0.0125 - 24/01/2012 - 0.1011 0.0002 26/01/2012 - - -0.0056 27/01/2012 - - 0.0001 

Thanks in advance.