Click here to Skip to main content
15,899,025 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to get a static result from a table? Pin
Mycroft Holmes22-Jun-12 13:14
professionalMycroft Holmes22-Jun-12 13:14 
AnswerRe: How to get a static result from a table? Pin
Luc Pattyn21-Jun-12 5:39
sitebuilderLuc Pattyn21-Jun-12 5:39 
AnswerRe: How to get a static result from a table? Pin
PIEBALDconsult21-Jun-12 6:32
mvePIEBALDconsult21-Jun-12 6:32 
QuestionCannot Register New Server in SQL Server 2008 Pin
Kujtim Hyseni21-Jun-12 2:31
Kujtim Hyseni21-Jun-12 2:31 
AnswerRe: Cannot Register New Server in SQL Server 2008 Pin
jschell22-Jun-12 13:24
jschell22-Jun-12 13:24 
GeneralRe: Cannot Register New Server in SQL Server 2008 Pin
Kujtim Hyseni23-Jun-12 1:02
Kujtim Hyseni23-Jun-12 1:02 
GeneralRe: Cannot Register New Server in SQL Server 2008 Pin
jschell24-Jun-12 12:17
jschell24-Jun-12 12:17 
GeneralRe: Cannot Register New Server in SQL Server 2008 Pin
Kujtim Hyseni24-Jun-12 22:45
Kujtim Hyseni24-Jun-12 22:45 
GeneralRe: Cannot Register New Server in SQL Server 2008 Pin
jschell25-Jun-12 9:34
jschell25-Jun-12 9:34 
GeneralRe: Cannot Register New Server in SQL Server 2008 Pin
Kujtim Hyseni25-Jun-12 10:35
Kujtim Hyseni25-Jun-12 10:35 
GeneralRe: Cannot Register New Server in SQL Server 2008 Pin
jschell26-Jun-12 8:09
jschell26-Jun-12 8:09 
AnswerRe: Cannot Register New Server in SQL Server 2008 Pin
Eddy Vluggen25-Jun-12 1:23
professionalEddy Vluggen25-Jun-12 1:23 
QuestionInserting rows dynamiccaly on based on calculation Pin
vkap20-Jun-12 11:45
vkap20-Jun-12 11:45 
AnswerRe: Inserting rows dynamiccaly on based on calculation Pin
Mycroft Holmes20-Jun-12 13:05
professionalMycroft Holmes20-Jun-12 13:05 
AnswerRe: Inserting rows dynamiccaly on based on calculation Pin
__TR__3-Jul-12 20:41
__TR__3-Jul-12 20:41 
Questionlan chat software Pin
Member 913183919-Jun-12 1:42
Member 913183919-Jun-12 1:42 
AnswerRe: lan chat software Pin
Richard MacCutchan19-Jun-12 2:01
mveRichard MacCutchan19-Jun-12 2:01 
AnswerRe: lan chat software Pin
Eddy Vluggen19-Jun-12 2:36
professionalEddy Vluggen19-Jun-12 2:36 
AnswerRe: lan chat software Pin
Paul Conrad19-Jun-12 8:19
professionalPaul Conrad19-Jun-12 8:19 
QuestionError 1064,.... please Help Pin
Jassim Rahma16-Jun-12 0:10
Jassim Rahma16-Jun-12 0:10 
AnswerRe: Error 1064,.... please Help Pin
Mycroft Holmes16-Jun-12 3:14
professionalMycroft Holmes16-Jun-12 3:14 
Questionif - else statement in sql Pin
begg15-Jun-12 8:36
begg15-Jun-12 8:36 
Hi,

I have a list to populate. I have a query to populate it in mssql 2008. It involves three tables. If the query returns the value then I populate it and it is done. But , if the query doesnot return anything then I want to run another select statement because I do not want to leave the list view empty. I have to populate at least the names of the client. It could be something simple but I am just beginning to use mssql so I am stuck.



Select C.name as Client ,
B.Detail as Detail from tableA A
left join tableB B on B.bID = A.bID
Left join tableC C on C.clientID = B.clientID
where aID= '100';

if does not return anything,

I want to run another sql to atleast get the name of the client even if there is no related detail with that client.

second sql would be

Select C.name as Client from tableA A

Left join tableC C on C.clientID = A.bID
where aID= '100'

[P.S. the bID field of Table A could actually either be bID as is or C.clientID inserted into bID field of Table C.]


I am confident about the queries but its just about extracting the values from the result.

Thanks,
AnswerRe: if - else statement in sql Pin
Corporal Agarn15-Jun-12 8:41
professionalCorporal Agarn15-Jun-12 8:41 
AnswerRe: if - else statement in sql Pin
Michael Potter15-Jun-12 10:18
Michael Potter15-Jun-12 10:18 
AnswerRe: if - else statement in sql Pin
vvashishta18-Jun-12 19:49
vvashishta18-Jun-12 19:49 

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.