Problem in query

sql server Sri Lanka
  • 9 years ago
    hello sir, i have a problem in creating a view my table name marksheet is roll no subject mo max 10001 english 89 100 10002 math 65 100 10003 history 78 100 now how can i make a view to display this format rollno english math history total 10001 89 65 78 mo/max plz help me
  • 9 years ago

    Can you explain more clearly what you want to achieve? From my current understanding, you have a table that looks like this.

    Roll no subject mo max
    10001 english 89 100
    10002 math 65 100
    10003 history 78 100

    I don't quite follow what you want to achieve in your view, particularly with regards to returning 10001 in your output. 

    I suspect however that you'll find your answer using the Pivots function and you can read more about it here.

    http://technet.microsoft.com/en-us/library/ms177410.aspx

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” - Rick Osborne