Forum Replies Created

Viewing 4 posts - 1 through 5 (of 5 total)

  • RE: delete query

    my mistake,

    you are right!

    I forgot to add where clause in the main query. This fix would serve the purpose.

    Thanks!

  • RE: delete query

    Hope this query may help you

    DELETE TOP (SELECT COUNT(*)-1 FROM temp WHERE path='C:\my\' ) FROM temp

  • RE: Inner Join issue

    My query is: -

    select * from [dbo].[Main Table]a

    where [drug name]='typeA' and not exists

    (select * from [dbo].[Main Table]b

    where a.[calendar year]=b.[calendar year] and

    a.[Patient ID]=b.[Patient ID] and

    b.[drug name]='typeB'

    --b.[drug name]'typeA'

    )

    ---added .[Patient ID]...

  • RE: Inner Join issue

    Hope this query may help you:-)

    select * from [dbo].[Main Table]a

    where [drug name]='typeA' and not exists(select * from [dbo].[Main Table]b where a.[calendar year]=b.[calendar year] and b.[drug name]='typeB')

Viewing 4 posts - 1 through 5 (of 5 total)