var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How do I imbed a select inside a select
I need a select that gets a value and than appends another value if the criteria is met otherwise nothing is appended.
The statement has a select with an imbedded select and when I execute it I get the error:
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Thia is a crude sample of the statement
SELECT ID + ( select * from tableB where TableB = 0 ) as result1
Why am I getting this error and how do I fix the statement?
DECLARE @count int
SET @count = (SELECT Count(*) FROM tableB WHERE field1 = 0)
SELECT id + @count As [result1]
A crude answer would be... No, nevermind... That's too easy.
An approximate answer would be use LEFT JOIN to get what you want.
For an exact answer, please post the actual code instead of somthing that is kinda close to it.
Here is the statement
SET @count = (SELECT Count(*) FROM TableT WHERE [TimeS = 0)
SELECT str(Project) + str(@count) As [result1]
That produces output
which is OK except I need a * chatacter in place of the 0
look at replace function.
The problem here is the value is any number > 0 and replace works with only one value
Why do you want the count if you're going to replace it with a * regardless of its value?
SELECT str(Project) + '*' As [result1]
The question is unclear. Provide details of your tables including sample data and your desired result.
Oh good. I thought I was the only one who doesn't understand what dbfrumsuser wants.