mardi 5 mai 2015

how to add data into list view from datatable

I have one confusion with SQL Query.

I have three tables, student, books, book_taken_by_student. In the last table we have all the details about books taken by students.

In list view I bind the student name as row vies and different books name as column vies from student and books table. The list view look like

| Book1 | Book2 | Book 3 | Book 4|

A |

B |

C |

D |

E |

F |


Now with help of book_taken_by_student table I want to bind Yes or No in front of student name related with book name taken by them

How I can solve this question.

Finally I want to show my list view like this

| Book1 | Book2 | Book 3 | Book 4|

A | Yes | No | Yes | Yes

B | No | Yes | Yes | No

C | No | Yes | Yes | No

D | Yes | No | Yes | Yes

E | Yes | No | Yes | Yes

F | No | Yes | Yes | Yes


Aucun commentaire:

Enregistrer un commentaire