Joining 2 select results into a single row

  • That is part of my requirement that the result should say that the job does not exist - if it does not.

    • This reply was modified 4 years, 2 months ago by  mtz676.
  • I’m not asking about the resultset, I know the entry must be there.

    The question is - where do you get it from? I mean - FROM ( the keyword)

    _____________
    Code for TallyGenerator

  • Please refer to the code from @ktflash.

    I had the code working I broke the existing code to return only 1 value(row/column) and that made it work with the outer select and all inner selects return only 1 value(row/column)

  • Congratulations. You've learnt to choose the worst solution of them all.

    How many times the query you end up with scans msdb.dbo.sysjobs?

    At least 3.

    vs 1 in left join.

    plus unnecessary UNION ALL and correlated subqueries.

    it's at least 3 times more load on the server that it has to be.

    The load might be not so significant in absolute terms, but I bet you do all the queries this way.

    Because when offered the right approach you would not take it because you simply cannot understand it. It looks to unfamiliar for you.

    _____________
    Code for TallyGenerator

  • Yes, not because I did not want to but because it was unfamiliar and difficult for me to understand. Not denying that.

    Thank you anyways.

  • mtz676 wrote:

    Yes, not because I did not want to but because it was unfamiliar and difficult for me to understand. Not denying that.

    Thank you anyways.

    Soooo, .... your solution is to give up and not bother to learn anything?  Really?  The concepts you need to solve your problem were laid out clearly by me several posts ago, on what is now page 1 of this thread.  Sergiy has also tried to help, but honestly, I'm not sure why you bothered to ask for help since you don't seem to be willing to accept it or learn from it.   You seem to be willing only to do what is easy and avoid anything difficult as if it were the plague.   You'll not likely get very far in your career that way...  And I'm very glad I'm not your boss...  what would I do if I had to ask you to go to a training class on something you've never worked on, that might be a challenge?

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply