Click here to Skip to main content
15,505,828 members
Home / Discussions / Database
   

Database

 
GeneralRe: Most complex SSIS package you have worked on Pin
Eddy Vluggen2-Nov-16 6:29
professionalEddy Vluggen2-Nov-16 6:29 
GeneralRe: Most complex SSIS package you have worked on Pin
ZurdoDev2-Nov-16 5:43
professionalZurdoDev2-Nov-16 5:43 
GeneralRe: Most complex SSIS package you have worked on Pin
Mycroft Holmes2-Nov-16 14:00
professionalMycroft Holmes2-Nov-16 14:00 
QuestionWhat should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Abhijit Mindcraft2-Nov-16 1:45
Abhijit Mindcraft2-Nov-16 1:45 
AnswerRe: What should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Chris Quinn2-Nov-16 4:14
Chris Quinn2-Nov-16 4:14 
AnswerRe: What should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Eddy Vluggen2-Nov-16 5:03
professionalEddy Vluggen2-Nov-16 5:03 
AnswerRe: What should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Basit Shah Syed18-Nov-16 3:47
Basit Shah Syed18-Nov-16 3:47 
QuestionUse Conditions In Query [MySQL] Pin
Django_Untaken1-Nov-16 10:41
Django_Untaken1-Nov-16 10: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 11:04
professionalZurdoDev1-Nov-16 11:04 
AnswerRe: Use Conditions In Query [MySQL] Pin
Richard Deeming1-Nov-16 11:24
mveRichard Deeming1-Nov-16 11:24 
QuestionRe: Use Conditions In Query [MySQL] Pin
Django_Untaken1-Nov-16 20:54
Django_Untaken1-Nov-16 20:54 
AnswerRe: Use Conditions In Query [MySQL] Pin
Richard Deeming2-Nov-16 3:51
mveRichard Deeming2-Nov-16 3:51 
AnswerRe: Use Conditions In Query [MySQL] Pin
phil.o1-Nov-16 15:01
mvephil.o1-Nov-16 15:01 
GeneralRe: Use Conditions In Query [MySQL] Pin
Django_Untaken1-Nov-16 20:45
Django_Untaken1-Nov-16 20:45 
GeneralRe: Use Conditions In Query [MySQL] Pin
phil.o1-Nov-16 22:19
mvephil.o1-Nov-16 22:19 
QuestionExtending SSIS components Pin
Rahul_Biswas26-Oct-16 20:11
professionalRahul_Biswas26-Oct-16 20:11 
QuestionRecursive CTE in T-SQL Pin
Rahul_Biswas24-Oct-16 23:15
professionalRahul_Biswas24-Oct-16 23:15 
AnswerRe: Recursive CTE in T-SQL Pin
Richard MacCutchan25-Oct-16 1:18
mveRichard MacCutchan25-Oct-16 1:18 
GeneralRe: Recursive CTE in T-SQL Pin
Rahul_Biswas25-Oct-16 1:44
professionalRahul_Biswas25-Oct-16 1:44 
GeneralRe: Recursive CTE in T-SQL Pin
Richard MacCutchan25-Oct-16 1:51
mveRichard MacCutchan25-Oct-16 1:51 
GeneralRe: Recursive CTE in T-SQL Pin
Rahul_Biswas25-Oct-16 1:58
professionalRahul_Biswas25-Oct-16 1:58 
GeneralRe: Recursive CTE in T-SQL Pin
Richard MacCutchan25-Oct-16 2:08
mveRichard MacCutchan25-Oct-16 2:08 
QuestionWhy SQL server maintenance plan Cannot rebuild clustered index offline? Pin
cornpoppy24-Oct-16 1:11
cornpoppy24-Oct-16 1:11 
AnswerRe: Why SQL server maintenance plan Cannot rebuild clustered index offline? Pin
Eddy Vluggen25-Oct-16 1:37
professionalEddy Vluggen25-Oct-16 1:37 
GeneralRe: Why SQL server maintenance plan Cannot rebuild clustered index offline? Pin
cornpoppy25-Oct-16 19:50
cornpoppy25-Oct-16 19: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.