SQL:Getting count from many tables for a user record in USER table.Whats the best approach?
问题 I have 4 SQL server(2008 version) tables 1) USER- to store user information (Fields : UserId,UserName) 2) FILES - to store files uploaded by user (FileId,FileName,UserId) 3) PHOTOS -to store files uploaded by user (PhotoId,PhotoName,UserId) 4) GROUPS= to store groups created by user ( GroupId,GroupName,UserId) Now I want to get a USER record with id=5 along with Total number of Files uploaded by userid 5,Total Photos uploaded by user id 5,Total groups created by userid 5.Can i get all these