Click here to Skip to main content
15,892,005 members
Home / Discussions / Database
   

Database

 
AnswerRe: Know the Database version Pin
leoinfo1-Aug-08 6:46
leoinfo1-Aug-08 6:46 
Questioninitcap problem Pin
jhyn31-Jul-08 16:01
jhyn31-Jul-08 16:01 
QuestionTriggers Pin
ROC_Jnr31-Jul-08 10:03
ROC_Jnr31-Jul-08 10:03 
AnswerRe: Triggers Pin
Wendelius31-Jul-08 10:17
mentorWendelius31-Jul-08 10:17 
GeneralRe: Triggers Pin
nelsonpaixao1-Aug-08 13:49
nelsonpaixao1-Aug-08 13:49 
Question[Message Deleted] Pin
naveenxyz31-Jul-08 10:02
naveenxyz31-Jul-08 10:02 
AnswerRe: sql query Pin
Kschuler31-Jul-08 10:14
Kschuler31-Jul-08 10:14 
QuestionAnother IN clause Question Pin
MaxRelaxman31-Jul-08 5:14
MaxRelaxman31-Jul-08 5:14 
I'm having some issues with a Query I'm trying to use to fine similar records in a master table. There are several child tables that will be searched in a similar way. Basically, if there are more than two matches in the sub query I want to display those records.
Can anyone point me in the right direction to get this query to work? I understand why I can't use more than one field in my subquery but I can't think of another way to do this.


SELECT *
FROM   UC
WHERE uc_key IN (SELECT mo_Key, COUNT(mo_key) as KeyCount 
		 FROM MO  
		 WHERE (mo_MoKey = @Key1 AND mo_Value = @Value1) OR (mo_MoKey = @Key2 AND mo_Value = @Value2) <- there will be a variable number of these that get generated programatically
                    AND KeyCount > 2)

(note, the table names have been mangled to protect the innocent)

Thanks, any ideas are appreciated.
AnswerRe: Another IN clause Question Pin
PIEBALDconsult31-Jul-08 6:44
mvePIEBALDconsult31-Jul-08 6:44 
GeneralRe: Another IN clause Question Pin
MaxRelaxman31-Jul-08 10:52
MaxRelaxman31-Jul-08 10:52 
GeneralRe: Another IN clause Question Pin
PIEBALDconsult31-Jul-08 10:54
mvePIEBALDconsult31-Jul-08 10:54 
GeneralRe: Another IN clause Question Pin
MaxRelaxman31-Jul-08 10:56
MaxRelaxman31-Jul-08 10:56 
GeneralRe: Another IN clause Question Pin
PIEBALDconsult31-Jul-08 11:06
mvePIEBALDconsult31-Jul-08 11:06 
AnswerRe: Another IN clause Question Pin
Wendelius31-Jul-08 6:48
mentorWendelius31-Jul-08 6:48 
GeneralRe: Another IN clause Question Pin
MaxRelaxman31-Jul-08 10:54
MaxRelaxman31-Jul-08 10:54 
QuestionQuery using multiple columns in IN Clause Pin
CodalcoholicNBrainy31-Jul-08 1:17
CodalcoholicNBrainy31-Jul-08 1:17 
AnswerRe: Query using multiple columns in IN Clause Pin
Syed Mehroz Alam31-Jul-08 1:23
Syed Mehroz Alam31-Jul-08 1:23 
GeneralRe: Query using multiple columns in IN Clause Pin
CodalcoholicNBrainy31-Jul-08 1:40
CodalcoholicNBrainy31-Jul-08 1:40 
GeneralRe: Query using multiple columns in IN Clause Pin
Syed Mehroz Alam31-Jul-08 1:43
Syed Mehroz Alam31-Jul-08 1:43 
GeneralRe: Query using multiple columns in IN Clause Pin
CodalcoholicNBrainy31-Jul-08 2:02
CodalcoholicNBrainy31-Jul-08 2:02 
GeneralRe: Query using multiple columns in IN Clause Pin
Syed Mehroz Alam31-Jul-08 2:36
Syed Mehroz Alam31-Jul-08 2:36 
GeneralRe: Query using multiple columns in IN Clause Pin
Blue_Boy31-Jul-08 3:18
Blue_Boy31-Jul-08 3:18 
GeneralRe: Query using multiple columns in IN Clause Pin
PIEBALDconsult31-Jul-08 3:55
mvePIEBALDconsult31-Jul-08 3:55 
GeneralRe: Query using multiple columns in IN Clause Pin
CodalcoholicNBrainy31-Jul-08 4:04
CodalcoholicNBrainy31-Jul-08 4:04 
GeneralRe: Query using multiple columns in IN Clause Pin
PIEBALDconsult31-Jul-08 6:45
mvePIEBALDconsult31-Jul-08 6:45 

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.