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

Database

 
AnswerRe: Get data form Table A that is not in Table B to a new Table C automatically Pin
Wendelius16-Oct-08 10:55
mentorWendelius16-Oct-08 10:55 
GeneralRe: Get data form Table A that is not in Table B to a new Table C automatically Pin
Thayhor17-Oct-08 1:34
Thayhor17-Oct-08 1:34 
GeneralRe: Get data form Table A that is not in Table B to a new Table C automatically Pin
Wendelius17-Oct-08 7:39
mentorWendelius17-Oct-08 7:39 
AnswerRe: Get data form Table A that is not in Table B to a new Table C automatically Pin
Mark Churchill17-Oct-08 4:18
Mark Churchill17-Oct-08 4:18 
QuestionSQL Functions Pin
Illegal Operation15-Oct-08 14:45
Illegal Operation15-Oct-08 14:45 
AnswerRe: SQL Functions Pin
Mycroft Holmes15-Oct-08 16:41
professionalMycroft Holmes15-Oct-08 16:41 
AnswerRe: SQL Functions Pin
Ashfield15-Oct-08 21:19
Ashfield15-Oct-08 21:19 
QuestionUsing IFs in T-SQL select statement Pin
redivider15-Oct-08 9:54
redivider15-Oct-08 9:54 
Here is my delema. A company row can have multiple representations in the security table, based on the priusa or prican values in the company table matching the iid values int he security table, or the values in company table being null, in which case i just want to match the cue of the first iid listed for the key in the security table.
The If section works if I change out the copmany.key references for a literal value, so as far as i can tell its having an issue with the assignment of the value to security.iid = (IF...).
Any ideas?


SELECT company.key, company.name, security.cue
FROM company LEFT OUTER JOIN
security ON company.key= security.key AND security.iid = (IF (select priusa FROM company WHERE key = company.key) is NOT NULL
BEGIN
select priusa FROM company WHERE key= company.key
END
ELSE
IF (select prican FROM company WHERE key= company.key) is NOT NULL
BEGIN
select prican FROM company WHERE key= company.key
END
ELSE
BEGIN
select TOP 1 iid FROM security WHERE key= company.key
ORDER BY security.iid
END)
WHERE (company.name like @name)
AnswerRe: Using IFs in T-SQL select statement Pin
Wendelius15-Oct-08 10:42
mentorWendelius15-Oct-08 10:42 
GeneralRe: Using IFs in T-SQL select statement Pin
redivider15-Oct-08 11:46
redivider15-Oct-08 11:46 
GeneralRe: Using IFs in T-SQL select statement Pin
Wendelius15-Oct-08 17:49
mentorWendelius15-Oct-08 17:49 
GeneralRe: Using IFs in T-SQL select statement Pin
PIEBALDconsult15-Oct-08 13:06
mvePIEBALDconsult15-Oct-08 13:06 
GeneralRe: Using IFs in T-SQL select statement Pin
Wendelius15-Oct-08 17:53
mentorWendelius15-Oct-08 17:53 
GeneralRe: Using IFs in T-SQL select statement Pin
redivider16-Oct-08 6:33
redivider16-Oct-08 6:33 
GeneralRe: Using IFs in T-SQL select statement Pin
Wendelius16-Oct-08 8:49
mentorWendelius16-Oct-08 8:49 
Questionanyone can explain 24 x 7 databases and 8 x 5 databases? Pin
alexyxj15-Oct-08 8:55
alexyxj15-Oct-08 8:55 
AnswerRe: anyone can explain 24 x 7 databases and 8 x 5 databases? Pin
Wendelius15-Oct-08 9:03
mentorWendelius15-Oct-08 9:03 
JokeRe: anyone can explain 24 x 7 databases and 8 x 5 databases? Pin
nelsonpaixao15-Oct-08 13:43
nelsonpaixao15-Oct-08 13:43 
QuestionRedundant Data? Pin
jesus.online15-Oct-08 3:52
jesus.online15-Oct-08 3:52 
AnswerRe: Redundant Data? Pin
Ashfield15-Oct-08 5:14
Ashfield15-Oct-08 5:14 
GeneralRe: Redundant Data? Pin
J4amieC15-Oct-08 5:21
J4amieC15-Oct-08 5:21 
GeneralRe: Redundant Data? Pin
Ashfield15-Oct-08 8:32
Ashfield15-Oct-08 8:32 
AnswerRe: Redundant Data? Pin
J4amieC15-Oct-08 5:20
J4amieC15-Oct-08 5:20 
GeneralRe: Redundant Data? Pin
Wendelius15-Oct-08 8:51
mentorWendelius15-Oct-08 8:51 
GeneralRe: Redundant Data? Pin
J4amieC16-Oct-08 1:44
J4amieC16-Oct-08 1:44 

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.