• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Reply to: SQL challenge

Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "SQL challenge"

Collapse

  • EqualOpportunities
    replied
    Originally posted by MarillionFan
    No. Whys that?
    Idle curiosity mate - nothing more...

    I should've guessed that you hadn't, really - if you had, you certainly wouldn't be going back

    Leave a comment:


  • MarillionFan
    replied
    No. Whys that?

    Leave a comment:


  • EqualOpportunities
    replied
    Originally posted by MarillionFan
    Going well as it happens. Been offered an extension if I want one, Ive just put in for an EDS role instead near Slough for £400pd. So fingers crossed on that one as well.

    5 by March!!!!!
    Ever worked for EDS before, MF?

    Leave a comment:


  • Mordac
    replied
    EDS and Slough? Not what one would call a happy combination. Brave lad. Best of luck.

    Leave a comment:


  • MarillionFan
    replied
    Going well as it happens. Been offered an extension if I want one, Ive just put in for an EDS role instead near Slough for £400pd. So fingers crossed on that one as well.

    5 by March!!!!!

    Leave a comment:


  • Mordac
    replied
    If you're that good why have you now had 4 contracts already this year and we're just halfway through February?

    How's the daytime TV gig going, btw?

    Leave a comment:


  • MarillionFan
    replied
    I assume by 'Real Men' your discussing David Beckham

    Leave a comment:


  • sasguru
    replied
    Originally posted by MarillionFan
    Crosstabs. No ability to format.
    Amateurs.

    As I am now a certified Trainer in CR as well as a Consultant anyone who would actually like training or training notes on how to use the thing properly as opposed to the hacking the rest of you do then drop me a line.

    Yep. Gay for £400 a day thanks.
    Well Interior designers earns lots of money too, but they're still gay. CR is a gay technology, full stop, not for real men.

    Leave a comment:


  • expat
    replied
    Originally posted by MarillionFan
    Crosstabs. No ability to format.
    Amateurs.

    As I am now a certified Trainer in CR as well as a Consultant anyone who would actually like training or training notes on how to use the thing properly as opposed to the hacking the rest of you do then drop me a line.
    Ahem, are you sure you're really investing your talents in the leading edge here?

    Leave a comment:


  • scotspine
    replied
    ok arkwright, but do you do chintz drapes as well?

    Leave a comment:


  • MarillionFan
    replied
    Crosstabs. No ability to format.
    Amateurs.

    As I am now a certified Trainer in CR as well as a Consultant anyone who would actually like training or training notes on how to use the thing properly as opposed to the hacking the rest of you do then drop me a line.

    Yep. Gay for £400 a day thanks.

    Leave a comment:


  • sasguru
    replied
    Originally posted by MarillionFan
    Run it through Crystal Reports. Then it's a piece of piss. 2 minute job. Nah. 1 minute.

    But then again, I doubt anyone would know how to even do that on here.
    You must be gay.

    Leave a comment:


  • scotspine
    replied
    only ever use cr if the client wants it used. used it a few weeks a go for similar crosstab and other queries but not my weapon of choice i have to say. lack of control over format etc etc

    Leave a comment:


  • MarillionFan
    replied
    Run it through Crystal Reports. Then it's a piece of piss. 2 minute job. Nah. 1 minute.

    But then again, I doubt anyone would know how to even do that on here.
    Last edited by MarillionFan; 14 February 2006, 22:40.

    Leave a comment:


  • f_eriksen
    replied
    although i think a couple of the previous posts have covered it, here is my take

    if the nr of possible events are know, ie yuo know there will be evt1,evt2 and evt3, you can do this quite simple using setbased (and standard) sql.

    select person,
    sum(case when event_id = 1 then 1 else 0 end) as cnt_event_1,
    sum(case when event_id = 2 then 1 else 0 end) as cnt_event_2,
    sum(case when event_id = 3 then 1 else 0 end) as cnt_event_3
    from mytable
    group by person

    if it is not, and you are not using ms sql 2005 (which implements crosstab), or ms sql 2000 with an additional 3rd party crosstab xp, then you can either:

    a) build a dynamic sql t obe executed via exec(@sql), or sp_executesql (ms specific). no need for cursors even, d oa coalesce with distinct to pick up the exact nr of events to match...

    b) use a cursor (which almost always sucks, and tells you u probably did somethin wrong)

    either way, the db will sort it out faster then taking the data out of there and process in some other language (i dont care what u guys say, datacentric processing win 9 out of 10 times).

    need specifics, let me know

    my 2 cents only,

    FGE

    Leave a comment:

Working...
X