Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select query

Author  Topic 

chiragvm
Yak Posting Veteran

65 Posts

Posted - 2007-04-26 : 01:07:01
hi to all
i have one confusion about select query
in query have two table

1) = eid, name, surmame, day, month, leve (empmaster)
2) = did, eid, month,leve (empdetail)

here is two table fields
i lost data of empdetail
so i want to one select query witch return me a summery of data
like

eid month leve
1 1 5
1 2 8
2 6 9
3 7 8

please help me

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-04-26 : 01:10:39
quote:
i lost data of empdetail

Does that mean there is no data in empdetail table? Also why month, leave columns are repeated both in empmaster and empdetail? If there is no data in empdetail, why do you want to consider that as a part of query?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-26 : 01:33:01
select eid, month, sum(leve) as leve from empmaster group by eid, month order by eid, month


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -