Forum Replies Created

Viewing 15 posts - 3,946 through 3,960 (of 10,144 total)

  • RE: I need help Please :(

    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...

  • RE: Replace

    Is this PostgreSQL?

  • RE: I need help Please :(

    Hi Sharon

    Can you confirm which SQL Server version you are using?

  • RE: SQL Help in grouping

    gksharmaajmer (10/2/2013)


    Thank you Chris for your continue support. Probably I am not able to find a bug in the query but when I am saying :

    SELECT *

    FROM #Results...

  • RE: wish to add rows having NULL values as placeholders for "missing" dates

    polkadot (10/2/2013)


    YIKES, I see the error. The where should be d.d>=

    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...

  • RE: The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified.

    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...

  • RE: performance issue

    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...

  • RE: SQL Help in grouping

    -- 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,...

  • RE: SQL Help in grouping

    The results of my query match your desired output table. What do you want me to do?

  • RE: SQL Help in grouping

    #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...

  • RE: SQL Help in grouping

    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(*)...

  • RE: update from multiple tables

    parthmeister (10/2/2013)


    Hi Folks,

    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...

  • RE: Slow Script

    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...

  • RE: Are the posted questions getting worse?

    jasona.work (10/1/2013)


    Well, should be a rather interesting next couple days / weeks / (REALLY hope not) months with the US Government going into shutdown.

    As some of you know, I'm now...

Viewing 15 posts - 3,946 through 3,960 (of 10,144 total)