Click here to Skip to main content
15,895,746 members
Home / Discussions / Database
   

Database

 
GeneralRe: Deploying Stored Procedures in Visual Studio - GRANT EXECUTE Pin
Wendelius12-Feb-09 6:06
mentorWendelius12-Feb-09 6:06 
GeneralRe: Deploying Stored Procedures in Visual Studio - GRANT EXECUTE Pin
Mike Ellison12-Feb-09 10:54
Mike Ellison12-Feb-09 10:54 
GeneralRe: Deploying Stored Procedures in Visual Studio - GRANT EXECUTE Pin
Wendelius12-Feb-09 11:23
mentorWendelius12-Feb-09 11:23 
GeneralRe: Deploying Stored Procedures in Visual Studio - GRANT EXECUTE Pin
Mike Ellison13-Feb-09 6:25
Mike Ellison13-Feb-09 6:25 
GeneralRe: Deploying Stored Procedures in Visual Studio - GRANT EXECUTE Pin
Wendelius13-Feb-09 22:54
mentorWendelius13-Feb-09 22:54 
GeneralRe: Deploying Stored Procedures in Visual Studio - GRANT EXECUTE Pin
Mike Ellison17-Feb-09 5:59
Mike Ellison17-Feb-09 5:59 
GeneralRe: Deploying Stored Procedures in Visual Studio - GRANT EXECUTE Pin
Wendelius17-Feb-09 7:27
mentorWendelius17-Feb-09 7:27 
QuestionSELECT Question Pin
MarkB77711-Feb-09 11:21
MarkB77711-Feb-09 11:21 
Hi,

I'm trying to use the query below in MSSQL.

<br />
SELECT [mxDelete],[mxContactID] <br />
FROM mxContact.dbo.Contacts <br />
WHERE mxContactID IN <br />
<br />
(SELECT [mxContactID], [mxzCopies]<br />
FROM <br />
(SELECT [mxContactID], [mxzCopies]<br />
FROM mxContact.dbo.Associations_Groups_to_Contacts <br />
WHERE mxGroupID='35EA110C-FE44-4A85-8D9A-AE973E2C5F85' <br />
OR mxGroupID='3CF66F58-F8E4-44CD-84A0-CB62F85E129B') <br />
AS COL<br />
GROUP BY mxContactID HAVING (COUNT(mxContactID) > 1))<br />


My question is, how can I make it so that the code in bold will give me the mxzCopies column as well.

If I select just the contactID, then it works fine, but with the addition of mxzCopies, it gives me:

Msg 8120, Level 16, State 1, Line 1
Column 'COL.mxzCopies' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Msg 116, Level 16, State 1, Line 1
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.



Cheers,

Mark.

Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog

AnswerRe: SELECT Question Pin
MarkB77711-Feb-09 11:39
MarkB77711-Feb-09 11:39 
QuestionIs it possible to restore sql2005 backup on sql2000????????? Pin
Aman786Singh11-Feb-09 4:52
Aman786Singh11-Feb-09 4:52 
AnswerRe: Is it possible to restore sql2005 backup on sql2000????????? Pin
Wendelius11-Feb-09 6:29
mentorWendelius11-Feb-09 6:29 
QuestionUsing XQuery to update an XML field in Sql Sever 2005 Pin
Rob Philpott11-Feb-09 3:30
Rob Philpott11-Feb-09 3:30 
AnswerRe: Using XQuery to update an XML field in Sql Sever 2005 Pin
Wendelius11-Feb-09 6:48
mentorWendelius11-Feb-09 6:48 
GeneralRe: Using XQuery to update an XML field in Sql Sever 2005 Pin
Rob Philpott11-Feb-09 22:00
Rob Philpott11-Feb-09 22:00 
GeneralRe: Using XQuery to update an XML field in Sql Sever 2005 Pin
Wendelius12-Feb-09 3:04
mentorWendelius12-Feb-09 3:04 
QuestionMulti Platform Database Pin
urbane.tiger10-Feb-09 14:57
urbane.tiger10-Feb-09 14:57 
AnswerRe: Multi Platform Database Pin
Wendelius10-Feb-09 18:48
mentorWendelius10-Feb-09 18:48 
GeneralRe: Multi Platform Database Pin
urbane.tiger10-Feb-09 23:08
urbane.tiger10-Feb-09 23:08 
GeneralRe: Multi Platform Database Pin
Wendelius11-Feb-09 1:03
mentorWendelius11-Feb-09 1:03 
GeneralRe: Multi Platform Database Pin
urbane.tiger11-Feb-09 1:47
urbane.tiger11-Feb-09 1:47 
Questioninstructor allocation! Pin
Learner52010-Feb-09 2:02
Learner52010-Feb-09 2:02 
AnswerRe: instructor allocation! Pin
J4amieC10-Feb-09 4:11
J4amieC10-Feb-09 4:11 
GeneralRe: instructor allocation Automatically! Pin
Learner52010-Feb-09 4:29
Learner52010-Feb-09 4:29 
GeneralRe: instructor allocation Automatically! Pin
J4amieC10-Feb-09 5:18
J4amieC10-Feb-09 5:18 
GeneralRe: instructor allocation Automatically! Pin
Learner52010-Feb-09 11:03
Learner52010-Feb-09 11:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.