SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Query


SQL Query

Author
Message
vshiva2379
vshiva2379
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 8
Thank you SSC Enthusiastic, I got it What i want
Dird
Dird
SSC-Addicted
SSC-Addicted (469 reputation)SSC-Addicted (469 reputation)SSC-Addicted (469 reputation)SSC-Addicted (469 reputation)SSC-Addicted (469 reputation)SSC-Addicted (469 reputation)SSC-Addicted (469 reputation)SSC-Addicted (469 reputation)

Group: General Forum Members
Points: 469 Visits: 808
ChrisM@home (7/28/2013)

I think you need another edit ;-)

Edit: beat me to it.


Ha Pinch


Dird
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)

Group: General Forum Members
Points: 85959 Visits: 41091
vshiva2379 (7/28/2013)
Thank you, But Sorry I didnt Get my result with that
My table is
Student

StudentID int,
name varchar(20),
maths int,
science int,
comp int

records are

1, Allen, 60, 80,75
2, John ,70,60,90
3, Kim, 86,85, 80

result should be

Allen science
John comp
Kim maths

Thank you


I'm thinking that you didn't actually read the article at the first link in my signature line below. And I agree with Chris. This looks like coursework (especially since the data is so badly denormalized). Please show us what you've tried. This should be a learning experience, not a hand out. And take the time to post the data in the readily consumable format identified in the article. That article will also teach you a couple of neat tricks in SQL

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
vshiva2379
vshiva2379
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 8
Sorry Jeff , That was my mistake i didnt give correct details,

Thanks allot for your valuable time
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)

Group: General Forum Members
Points: 85959 Visits: 41091
vshiva2379 (7/28/2013)
Execuse me

Since you did not understand i how given that data and more over i do not want to disclose my original data i have given that, if you insist then have a look

Create table Student(Studentid int,name varchar(50),maths int,science int,com int)

insert into Student values(1,'Allen',40,50,89)
insert into Student values(2,'John',70,90,89)
insert into Student values(1,'Nick',90,80,89)

Thank you


Heh... if I insist. :-D It's your question, bud. Look how fast people responded when you posted it in a readily consumable format.

The question now is, do you actually understand the code that gave you the desired answer?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
vshiva2379
vshiva2379
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 8
I am very Sorry about that but i was bit worried with the query i was not getting, Thanks allot to every one, I got my answer and i have completed my work
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)

Group: General Forum Members
Points: 85959 Visits: 41091
vshiva2379 (7/28/2013)
I am very Sorry about that but i was bit worried with the query i was not getting, Thanks allot to every one, I got my answer and i have completed my work


No problem. The question remains, though... do you understand the solution?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search