Click here to Skip to main content
15,886,026 members
Home / Discussions / Database
   

Database

 
GeneralRe: Most complex SSIS package you have worked on Pin
Eddy Vluggen2-Nov-16 5:29
professionalEddy Vluggen2-Nov-16 5:29 
GeneralRe: Most complex SSIS package you have worked on Pin
ZurdoDev2-Nov-16 4:43
professionalZurdoDev2-Nov-16 4:43 
GeneralRe: Most complex SSIS package you have worked on Pin
Mycroft Holmes2-Nov-16 13:00
professionalMycroft Holmes2-Nov-16 13:00 
QuestionWhat should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Abhijit Mindcraft2-Nov-16 0:45
Abhijit Mindcraft2-Nov-16 0:45 
AnswerRe: What should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Chris Quinn2-Nov-16 3:14
Chris Quinn2-Nov-16 3:14 
AnswerRe: What should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Eddy Vluggen2-Nov-16 4:03
professionalEddy Vluggen2-Nov-16 4:03 
AnswerRe: What should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Basit Shah Syed18-Nov-16 2:47
Basit Shah Syed18-Nov-16 2:47 
QuestionUse Conditions In Query [MySQL] Pin
Django_Untaken1-Nov-16 9:41
Django_Untaken1-Nov-16 9:41 
Hello there. First let me give the 3 tables' definitions then I ask question.

Users
UserId
UserName

Members
MemberId
MemberName

Orders
OrderId
UserId
IsUserMember
ItemName

In 3rd table, you can see that I am using boolean column which tells whether this Order belongs to guest user or member user. I want to select corresponding data using ONE QUERY. Here is what I have tried so far but it is far from working

<br />
SELECT O.*, CASE WHEN O.IsUserMember = 1 THEN U.UserName ELSE M.MemberName END <br />
FROM Orders O, CASE WHEN O.IsUserMember = 1 THEN Users U ELSE Members M END <br />
WHERE CASE WHEN O.IsUserMember = 1 THEN O.UserId = U.UserId ELSE B.UserId = M.MemberId END;<br />


It is giving me this following error:
Syntax error near 'CASE WHEN B.IsThisUserMember = 1 THEN Users U ELSE Members M END WHERE CASE WHEN' at line 1

NOTE: If I remove first CASE condition, then I get empty set. Thanks for whatever you share.
AnswerRe: Use Conditions In Query [MySQL] Pin
ZurdoDev1-Nov-16 10:04
professionalZurdoDev1-Nov-16 10:04 
AnswerRe: Use Conditions In Query [MySQL] Pin
Richard Deeming1-Nov-16 10:24
mveRichard Deeming1-Nov-16 10:24 
QuestionRe: Use Conditions In Query [MySQL] Pin
Django_Untaken1-Nov-16 19:54
Django_Untaken1-Nov-16 19:54 
AnswerRe: Use Conditions In Query [MySQL] Pin
Richard Deeming2-Nov-16 2:51
mveRichard Deeming2-Nov-16 2:51 
AnswerRe: Use Conditions In Query [MySQL] Pin
phil.o1-Nov-16 14:01
professionalphil.o1-Nov-16 14:01 
GeneralRe: Use Conditions In Query [MySQL] Pin
Django_Untaken1-Nov-16 19:45
Django_Untaken1-Nov-16 19:45 
GeneralRe: Use Conditions In Query [MySQL] Pin
phil.o1-Nov-16 21:19
professionalphil.o1-Nov-16 21:19 
QuestionExtending SSIS components Pin
Rahul_Biswas26-Oct-16 19:11
professionalRahul_Biswas26-Oct-16 19:11 
QuestionRecursive CTE in T-SQL Pin
Rahul_Biswas24-Oct-16 22:15
professionalRahul_Biswas24-Oct-16 22:15 
AnswerRe: Recursive CTE in T-SQL Pin
Richard MacCutchan25-Oct-16 0:18
mveRichard MacCutchan25-Oct-16 0:18 
GeneralRe: Recursive CTE in T-SQL Pin
Rahul_Biswas25-Oct-16 0:44
professionalRahul_Biswas25-Oct-16 0:44 
GeneralRe: Recursive CTE in T-SQL Pin
Richard MacCutchan25-Oct-16 0:51
mveRichard MacCutchan25-Oct-16 0:51 
GeneralRe: Recursive CTE in T-SQL Pin
Rahul_Biswas25-Oct-16 0:58
professionalRahul_Biswas25-Oct-16 0:58 
GeneralRe: Recursive CTE in T-SQL Pin
Richard MacCutchan25-Oct-16 1:08
mveRichard MacCutchan25-Oct-16 1:08 
QuestionWhy SQL server maintenance plan Cannot rebuild clustered index offline? Pin
cornpoppy24-Oct-16 0:11
cornpoppy24-Oct-16 0:11 
AnswerRe: Why SQL server maintenance plan Cannot rebuild clustered index offline? Pin
Eddy Vluggen25-Oct-16 0:37
professionalEddy Vluggen25-Oct-16 0:37 
GeneralRe: Why SQL server maintenance plan Cannot rebuild clustered index offline? Pin
cornpoppy25-Oct-16 18:50
cornpoppy25-Oct-16 18:50 

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.