Forum Replies Created

Viewing 15 posts - 16 through 30 (of 215 total)

  • RE: max row for each id

    hI ,

    Try this...

    SELECT ID_T,MAX(INFO),MAX(DT) FROM IQ_1

    GROUP BY ID_T

     

    Thanks

    Amit

  • RE: what is the wrong with this update

    Hi,

    I have a query use it its working...........

     

    UPDATE SM  SET active = 0 

    FROM studentmaster SM Join studentdetail  SD On studentmaster .orderset_sys = studentdetail.orderset_sys WHERE 

    order_text like  '%continuation of class%'and class_ID=...

  • RE: Min values

    Hi ,

    If TestResult is a varchar column then convert it into integer and then perform the Min or Max on it.

     

  • RE: Ranking records in query results

    Hi ,

    Try This Solution , iTS WORKING fINE :

    create table Load_Data

    (

    rowid int identity(1,1),

    data int

    )

    insert into Load_Data

    select 100

    union all

    select 125

    union all

    select  125

    union all

    select 150

    union all

    select 175

    select a.rowid,a.data,count(*) from...

  • RE: Puzzler: Three consecutive rows

    Hi ,

    Try this one out.....

    select * from @Appt a

    join

    (select patient,prov from @Appt

    group by patient,prov

    having count(*) =3) b

    on a.patient=b.patient and

        a.prov=b.prov

     

    Thanks & Regards

    Amit Gupta

  • RE: help needed in query....

    Hi Vidhya ,

    It means u can't categorise it form a table. If both of document has same status..

     

    Is there any categorisation between stucked or busy...

    Regards

    Amit GUpta

     

  • RE: Query help

    Hi ,

    This this Solution it will also handled the Null values in MS_ID....

    select MS_ID, Amount

    from TableA

    where isnull(ms_id,'') <> ''

     

    Regards

    Amit

  • RE: Distinct with no order

    Hi ,

    Try using this query i think it might solve ur problem.........

    select distinct empid , newid() from dbo.Employee

    order by newid()

     

    Regards ,

    Amit Gupta

  • RE: Getting duplicates

    Hi Best ,

    Wht kind of duplicacy it is.... Do u have some sample data which u can provide...

    Thanks & Regards..

    Amit Gupta..

  • RE: Help - How to build this query

    Hi ,

    Try this Query its working.....

    select B.booknum , isnull(b.price,0) + isnull(ES.price,0) + isnull(Aseg.price,0)   from (

    select B.booknum , sum (isnull(Hn.Price,0)) Price

    from booking b

    left outer join

    (select booknum , price  from...

  • RE: Calculating the Last Friday of any date

    Hi ,

    Try this Query its working......

    set datefirst 1

    select dateadd(dd,(case when datepart(dw,convert(datetime,'2007-03-15')) < 5 then

    -(7 - (5 - datepart(dw,convert(datetime,'2007-03-15'))))

    else

    - (datepart(dw,convert(datetime,'2007-03-15')) - 5)

    end

    ),convert(datetime,'2007-03-15'))

    Regards ,

    Amit Gupta

  • RE: Multidimensional query?

    Hi erden ,

    We r not able to see anything.....

     

    Regards,

    Amit Gupta

  • RE: Multidimensional query?

    Hi erden ,

    We r not able to see anything.....

     

    Regards,

    Amit Gupta

  • RE: Multidimensional query?

    Hi erden ,

    We r not able to see anything.....

     

    Regards,

    Amit Gupta

  • RE: how to check on six fields if the same value exist

    Hi Midan1,

    I think , it can solve ur problem.. it returns to u if all columns have same value including Nulls also..........

    select * from Tab_exists

    where isnull(col1,'')+isnull(col2,'')+isnull(col3,'')+isnull(col4,'')+

    isnull(col5,'')+isnull(col6,'')=isnull(Replicate(coalesce(col1,col2,col3,col4,col5,col6),6),'')

     

    Regards

    Amit Gupta

    /*...

Viewing 15 posts - 16 through 30 (of 215 total)