Forum Replies Created

Viewing 15 posts - 181 through 195 (of 568 total)

  • RE: HOw to get

    select t from

    (select t,r,c

    from @t left join @t1

    on t = r

    or t = c) as x

    where r is null

    and c is null

  • RE: Update, union, create view ?!

    Hi,

    Try this

    CREATE TABLE #table2

    (

    main CHAR (10),

    sub CHAR (10)

    )

    insert into #table2

    select 'main1','sub1'

    union all

    select 'main1','sub2'

    union all

    select 'main1','sub3'

    union all

    select 'main2','sub4'

    union all

    select 'main2','sub5'

    union all

    select 'main3','sub6'

    union all

    select 'main3','sub7'

    union all

    select 'main3','sub8'

    --GROUP...

  • RE: update command

    Paul White (11/7/2009[font="Courier New"]Msg 512, Level 16, State 1, Line 17

    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >,...

  • RE: Log file is full

    Hi Sanket,

    In the BOL for shrink files shows: “The database being shrunk does not have to be in single-user mode; other users can be working in the database when the...

  • RE: update command

    Hi,

    try this

    update a

    set a.MemoStatus = (case when (select 1 from MemoDetail b where b.EmployeeId = a.EmployeeId )=1 then 'Y'else 'N' end)

    from Employee a

  • RE: null values

    SELECT PRICE,

    SERVICE_FEE,

    isnull(DOWN_PAYMENT,0) [DOWN_PAYMENT],

    (PRICE+SERVICE_FEE- isnull(DOWN_PAYMENT,0)) [AMOUNT OWED]

    FROM ACCOUNTS;

    IN SQL isnull(variable, new_value)

    IN ORACLE nvl(variable, new_value)

  • RE: Interesting point when using CASE

    Hi,

    Nice analysis,

    Can you post this in to Contribution Center (Question of the Day), so many may learn this section.

  • RE: Advice on Budget code

    Hi,

    Is any reason for the first month (i.e. @YearStartdate)treated as the day one ie day(@YearStartdate) always = 1, it is correct?

    However unless full tables schema and sample data its...

  • RE: Need help on Count row with rules

    Sharul Nizam (11/6/2009)


    --RID always same, TrnxID always unique, RNam alway same

    --BusN may be same may be not, TTime always unique

    --TripDte always same, TTID sometime no value sometime have value

    --SeatN may...

  • RE: Need help on Count row with rules

    Sharul Nizam (11/6/2009)


    is that true?

    Hi,

    NO, group by all columns gives difference count in the above case; post your full table with sample data may give some clarity.

  • RE: Need help on Count row with rules

    Hi,

    Try this

    select t1.TrnxID,strPosi,posi,count(posi)coun

    from

    @tPosiHdr t1 left outer join @tPosiDtl t2

    on t1.TrnxID=t2.TrnxID

    and t1.strPosi <> t2.Posi

    group by t1.TrnxID,strPosi,posi

  • RE: Table with only one record

    SQL Guy-482125 (11/5/2009)


    I need to create a table where number of records will be restricted only to one record.

    Hi,

    What purpose you need to keep only one row? Whether you maintain...

  • RE: Stored Proc that joins based on parameters??

    Hi,

    Either you pass the RegionID or the deliveryid are mandatory to your procedure, then you use the IF condition like

    IF (@RegionID is not null) and (@deliveryid is null)

    BEGIN

    YOUR STATEMENTS

    END

    ELSE

    IF...

  • RE: import data from vistaDb

    Repeated post,

    Discussion already start in

    http://www.sqlservercentral.com/Forums/Topic811984-149-1.aspx

Viewing 15 posts - 181 through 195 (of 568 total)