Viewing 15 posts - 3,946 through 3,960 (of 10,144 total)
CREATE TABLE EMPTMS
(Uidfirstname varchar (50),
Uidlastname varchar(50),
Reader int,
dtdate datetime);
INSERT INTO EMPTMS (uidfirstname, uidlastname, reader, dtdate) VALUES
('001','Alvin','1','2013-09-20 6:30:000 '),
('001','Alvin','2','2013-09-20 17:50:000 '),
('002','Rebecca','1','2013-09-20 22:10:000 '),
('003','Aliyah','1','2013-09-20 9:08:000 '),
('002','Rebecca','2','2013-09-21 7:30:000 '),
('001','Alvin','1','2013-09-21 6:30:000 '),
('001','Alvin','2','2013-09-21 17:50:000 '),
('002','Rebecca','1','2013-09-21...
October 3, 2013 at 6:17 am
Hi Sharon
Can you confirm which SQL Server version you are using?
October 3, 2013 at 12:57 am
gksharmaajmer (10/2/2013)
SELECT *
FROM #Results...
October 3, 2013 at 12:55 am
polkadot (10/2/2013)
and not dbj.starttime >=
This works:
select * from cannedbackupjobs dbj
full outer join _dates d on d.d = CONVERT(VARCHAR(10), dbj.starttime, 120)
where...
October 2, 2013 at 9:13 am
ORDER BY operates at the outermost level of a query and on the output rows. Where you've placed it in your sproc looks correct.
It doesn't make logical sense to...
October 2, 2013 at 8:20 am
As Gail states.
You may get some mileage from this:
-- Extract this chunk of your query separately
--------------------------------------------------------------------
JOIN OSS_BENCHMARK_PRICE_REFERENCE PR
ON L.DAILY_BENCHMARK_LOCAL_SEQ=PR.DAILY_BENCHMARK_LOCAL_SEQ
JOIN RD_MARKET_PRICE MP
ON MP.MARKET_PRICE_SEQ=PR.MARKET_PRICE_SEQ
OR MP.MARKET_PRICE_SEQ=PR.FUEL_MARKET_PRICE_SEQ
OR MP.MARKET_PRICE_SEQ=PR.GAS_MARKET_PRICE_SEQ...
October 2, 2013 at 6:21 am
-- like this
SELECT
s.course_id, s.course_name,
roll_no = MIN(s.roll_no),
student_name = CASE WHEN g.SetSize = 1 THEN MIN(s.student_name) ELSE 'Default' END,
s.geog_marks, s.math_marks
FROM #students s
INNER JOIN (
SELECT course_id, geog_marks, math_marks,...
October 2, 2013 at 5:52 am
The results of my query match your desired output table. What do you want me to do?
October 2, 2013 at 4:33 am
#students is a local temporary table I used instead of the permanent sample table students. Just remove the #.
g.SetSize is the calculated row count of the set in the partition...
October 2, 2013 at 4:01 am
SELECT
s.course_id, s.course_name,
roll_no = MIN(s.roll_no),
student_name = CASE WHEN g.SetSize = 1 THEN MIN(s.student_name) ELSE 'Default' END,
s.geog_marks, s.math_marks
FROM #students s
INNER JOIN (
SELECT course_id, geog_marks, math_marks, SetSize = COUNT(*)...
October 2, 2013 at 2:21 am
parthmeister (10/2/2013)
i am using 4 tables company, users, ARSAP, ARCUS to update a column in company table.
the tsql i am using is below.
UPDATE c
SET c.comp_primaryuserid = u.user_userid
FROM Company...
October 2, 2013 at 1:46 am
This I reckon is the correct way to write your query:
select T2.COL1, T2.COL2, T1.COL1, T1.COL2, T1.COL3
from T1
join T2
on T1.COL4 = T2.COL3
where T2.COL4 != 'data1'
and T1.COL1 is not NULL
and T1.COL5...
October 1, 2013 at 8:56 am
jasona.work (10/1/2013)
As some of you know, I'm now...
October 1, 2013 at 6:36 am
Viewing 15 posts - 3,946 through 3,960 (of 10,144 total)