Viewing 15 posts - 946 through 960 (of 1,923 total)
How about this?
select ISNULL(ItemSubID ,ItemSubValue ) ItemSubID , ItemSubValue from #TempData
where ( ItemSubID is null and ItemSubValue < 0 )
or ItemSubID = ItemSubValue
February 17, 2011 at 7:56 pm
Jeff Moden (2/17/2011)
CC... try your code against the data I posted. You may have a surprise in store.
Oh yeah, now i get it , Jeff.. completely missed it ;...
February 17, 2011 at 7:44 pm
As GSquared hinted, this looks like a homework..But as u are insisting, i am providing a solution.
declare @tab table
( student_id int,
School_Id int
)
insert into @tab
select 100 , 1
union all...
February 17, 2011 at 7:28 pm
They could be used in SELECT when there is a column from the 2 tables having the same name. Like
SELECT A.Sum_Col1 , B.Sum_Col1
FROM
( select SUM(Col1) Sum_Col1 FROM ...
February 17, 2011 at 1:54 am
brett.y (2/16/2011)
February 16, 2011 at 6:50 pm
Oops, Jeff had already posted the same solution 🙂 Sorry Jeff,dint see it 🙂
February 16, 2011 at 6:45 pm
How about this?
DECLARE @Scheduled VARCHAR(2) = '3'
,@BeginTime VARCHAR(8) = '05:55:00'
...
February 16, 2011 at 6:43 pm
Yes we have got the sample data, but what do u want to achieve from that? I mean, can u be still more clear on your requirement.
February 16, 2011 at 10:58 am
Can you please be more specific on your requirement ? I am unable to figure it from your initial post.. This (all possible combination) seems doable with CROSS JOINS ,...
February 16, 2011 at 8:17 am
brett.y (2/16/2011)
February 16, 2011 at 8:12 am
How about this?
declare @data1 table ( Name varchar(10), datepar varchar(25))
insert into @data1
select 'Smith', '3/16/2010@0930'
union all select 'Smith', '3/16/2010@1100'
union all select 'Smith', '3/17/2010@1300'
declare @data2 table...
February 16, 2011 at 7:06 am
You dint provide sample data yet.. you are providing us only Expected Result and the current result.. PLease post the sample data, then we will straightaway work on this 🙂
February 16, 2011 at 6:52 am
How about this?
SELECT T1C1 , T2C1
FROM
( select SUM(Col1) T1C1 FROM T1 ) A
CROSS JOIN
( select SUM(Col1) T2C1 FROM T2 ) B
February 16, 2011 at 6:42 am
First, let us set-up the sample data:
DECLARE @Configuration TABLE
(
ID INT,
NAME VARCHAR(3)
)
INSERT INTO @Configuration
SELECT...
February 16, 2011 at 2:23 am
Viewing 15 posts - 946 through 960 (of 1,923 total)