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.
| Author |
Topic |
|
vedjha
Posting Yak Master
228 Posts |
Posted - 2008-11-13 : 10:10:34
|
| I have to fetch ID from members table and compare it with existing tableasdeclare @ids varchar(10)select @ids=aid from members where cstatus='V' and aid like 'U%'using these ID satisfy condition and get resultselect count(ipoint) from members m join login l on m.aid=l.aid join scratch son m.aid=s.vat_id join package pon s.vpackage=p.vpackagewhere m.aid like 'U%' and dtdoj between '06/26/2008' and '07/25/2008'and isid=@idsVed Prakash Jha |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-13 : 10:15:20
|
isnt just this enough?select count(ipoint) from members m join login l on m.aid=l.aid join scratch son m.aid=s.vat_id join package pon s.vpackage=p.vpackagewhere m.aid like 'U%' and dtdoj between '06/26/2008' and '07/25/2008'and cstatus='V' |
 |
|
|
vedjha
Posting Yak Master
228 Posts |
Posted - 2008-11-13 : 10:17:58
|
| NO have to check by ID it will show total points.Findd the points; group by isidVed Prakash Jha |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-13 : 10:21:05
|
| [code]select m.isid,count(ipoint) from members m join login l on m.aid=l.aid join scratch son m.aid=s.vat_id join package pon s.vpackage=p.vpackagejoin (select aid from members where cstatus='V' and aid like 'U%') m1on m1.aid=m.isidwhere m.aid like 'U%' and dtdoj between '06/26/2008' and '07/25/2008'group by m.isid[/code] |
 |
|
|
vedjha
Posting Yak Master
228 Posts |
Posted - 2008-11-13 : 10:25:12
|
| thank.... :)Ved Prakash Jha |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-13 : 10:27:25
|
welcome |
 |
|
|
|
|
|