sql

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 128
Reputation: sivak has a little shameless behaviour in the past 
Solved Threads: 0
sivak sivak is offline Offline
Junior Poster

sql

 
0
  #1
Jan 13th, 2009
i have employee table with 3 coloums
emp name companyname experience
1 1 3.5
2 2 4.0
1 1 2.6
2 2 3.0
3 3 5.0
i want the result table like this
emp name comany name experience
1 1 6.1
2 2 7.0
3 3 5.0
anyone tell me the sql query for this ?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: sql

 
0
  #2
Jan 13th, 2009
What have you tried? You give no example code, so we have no information to help you with .. looks like a simple case of sorting and grouping to me.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,984
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 289
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso

Re: sql

 
0
  #3
Jan 13th, 2009
select unique or select distinct?
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: sql

 
1
  #4
Jan 13th, 2009
Looking at the numbers hes adding the results together.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,984
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 289
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso

Re: sql

 
0
  #5
Jan 13th, 2009
Yeah LizR, remarkable sight you have!

select sum(experience) from table... where...?
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: sql

 
0
  #6
Jan 13th, 2009
Well Ive given some big hints up earlier too.. but yes, the SQL for it should be a real simple 1 line uncomplex answer.. Im interested to see what the original posters tried so far.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 276
Reputation: rapture has a spectacular aura about rapture has a spectacular aura about 
Solved Threads: 37
rapture rapture is offline Offline
Posting Whiz in Training

Re: sql

 
0
  #7
Jan 13th, 2009
That wasn't easy for me to see and if you hadn't pointed it out I don't know if I would have caught it.

how in the world did you see that randomly?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: sql

 
0
  #8
Jan 13th, 2009
Because to me its obvious - Im that odd.

Of course it would help if the initial poster could define their requirements in proper terms it would help them help themselves.

Far too many posts are a bunch almost nonsensical jabberings and with a final comment of all but "code please" .. if you cant define clearly what you want, its highly likely you wont be able to code it either.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 2
Reputation: motin is an unknown quantity at this point 
Solved Threads: 1
motin motin is offline Offline
Newbie Poster

Re: sql

 
0
  #9
Jan 14th, 2009
I am not clear about your table because what is entity in your table.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 4
Reputation: Squirrel1984 is an unknown quantity at this point 
Solved Threads: 0
Squirrel1984 Squirrel1984 is offline Offline
Newbie Poster

Re: sql

 
0
  #10
Jan 14th, 2009
SELECT
E.empname, E.companyname as 'Company Name', Sum(E.experience) as 'Experience'
FROM employee E
GROUP BY E.empname, E.companyname
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC