Forum Replies Created

Viewing 15 posts - 31 through 45 (of 402 total)

  • RE: Problem with Co-Related Subquery

    Agreed, I would be interested in seeing that as well!

  • RE: Problem with Co-Related Subquery

    Hi

    It could be re-written like this:

    SELECT TOP (1000)

    jp.labor_type,

    jp.revision,

    jp.seeker_name,

    available.availablecount,

    hired.hiredcount

    FROM

    dbo.task_posting jp(nolock)

    INNER JOIN dbo.task_distribution jpd(nolock) ON jp.task_id = jpd.task_id

    LEFT JOIN

    (SELECT

    COUNT(*) availablecount

    ,task_id

    FROM

    dbo.task_seek js(nolock)

    WHERE

    js.status IN (1,7,8) AND js.worker_code = 'ADO'

    GROUP BY

    task_id

    ) AS available

    ON jp.task_id...

  • RE: SQL query help

    Hi

    SELECT

    learner

    , model

    FROM

    tablename

    WHERE

    learner in (SELECT Learner FROM tablename WHERE MODEL IN (21,20,30,99))

    Edit: oops didn't twig this may be homework!

    Andy

  • RE: problem in sql server

    Something like this at all?

    Details are pretty vague!

    DECLARE @id INT = 1234567890

    SELECT LEFT(stuff(@id,2,3,''),2)

    Andy

  • RE: Max of 2 dates

    Something like this?

    WITH CTE

    AS

    (

    SELECT Date

    FROM

    Table1

    UNION ALL

    SELECT date

    FROM

    Table2

    )

    SELECT MAX(Date)

    FROM

    CTE

    Andy

  • RE: Max of 2 dates

    Shadab Shah (6/25/2013)


    I search for Date functions for finding the max of the 2 dates. But such function does not exits.

    Is there any easy way to do it.

    Thanks in advance.

    this...

  • RE: From Networking to Data analyst: Help

    kgeeel240 (6/21/2013)


    Hi I studied networking exactly after graduation i got an Internship from the BI side I took i was desperate I have a son to raise now after...

  • RE: Trying to understand this SQL Query

    mickyT (6/18/2013)


    Oracle765 (6/18/2013)


    Hi all

    yes i agree, i am not sure about the left out join thats what has confused me a bit.

    would this query provide the same results?

    SELECT distinct a1.Netbios_Name0,...

  • RE: Trying to understand this SQL Query

    Hi

    What don't you understand about it?

    Looks like the GROUP BY is not needed (Unless its in an effort to eliminate duplicates)

    Andy

  • RE: SQL Server Version

    SQL 2012 at the moment 🙂

  • RE: SQL 2012 and AG's

    Bobby Glover (6/14/2013)


    Recent post from Brent Ozar. Is what he is saying correct.

    In SQL 2012, if your primary drops offline or the cluster loses quorum, the readable replica databases drop...

  • RE: Add a value IF ISNULL

    Hi try

    ISNULL(Country,'GB')

  • RE: To Split SP or Not to Split SP

    Gail, Thanks you were spot on with that excellent article.

    Bookmarked for future reference 😀

    Cheers

    Andy

  • RE: To Split SP or Not to Split SP

    Eugene Elutin (5/14/2013)


    that classical question was answered long ago ;-):

    http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/

    Hi Eugene

    Thanks for taking the time to have a look.

    I may be being a little obtuse here so my apologies if...

  • RE: IS NULL in a Case Statement

    ssmith 29602 (5/10/2013)


    This is probably very simple but I can't get it to work.

    If trying to write this

    Case Oppo_stage When 'Bus_Written' Then (oppo_closed is null or Oppo_Closed >= GETDATE() -7)

    but...

Viewing 15 posts - 31 through 45 (of 402 total)