Forum Replies Created

Viewing 15 posts - 91 through 105 (of 568 total)

  • RE: Create one record for each in quotient

    create table #temp

    (

    SKU int,

    Qty int,

    PKQTY int

    )

    insert into #temp

    select 123,100,25

    union all

    select 321,200,100

    union all

    select 555,500,100

    SELECT SKU,Qty,PKQTY

    FROM

    (select slno from

    (select 1 slno

    union all

    select 2

    union all

    select 3

    union all...

  • RE: How to write query for following problem

    amitsingh308 (1/5/2010)


    But i want to group by only with email, because some time names are different but emails are same so i need to result according to group of email....

  • RE: how use oderby with different columns

    Hi,

    Desired order by is not possible or you post the wrong output.

    However, you just use the normal order by class

    Select * from MYTABLE

    Order by col1, col2, col3

    col1|col2|col3

    A|A|001

    A|B|002

    A|C|003

    B|A|003

    B|B|001

    B|C|002

  • RE: select on 2 tables-(current and historical table)

    Hi,

    Ensure that the OH table having the unique values for each history and just build this as procedure than pass the search value.

    create table #testOH

    (

    tsh_orderid char (16) null,

    tsh_group smallint...

  • RE: How to write query for following problem

    now I want to calculate the sum of all transaction which are more than 500, having same email id.

    Name city ...

  • RE: select on 2 tables-(current and historical table)

    Hi,

    The first table testv and the search result is more over matches by the above I mentioned, and how the second table testOH related to the tsv_orderid, this is my...

  • RE: exec xp_cmdshell

    Hi,

    Ensure your out put should in row format.

    create MYTABLE

    (

    slno int identity(1,1),

    Result varchar(20)

    )

    insert into MYTABLE

    select @result

    select max(case when slno = 1 then Result else '' end) COL1,

    max(case when slno =...

  • RE: select on 2 tables-(current and historical table)

    Hi,

    What you try so far, is any statement you build to achieve?

    ok, try in this way

    /*create the table with additional column*/

    create table #testv

    (

    slno int identity(1,1),

    tsv_orderid char (16) null,

    tsv_group smallint...

  • RE: Multiple Update Records

    update aa

    set aa.Sgpa = a.Sgpa,

    aa.Cgpa = a.Cgpa

    from

    GradePointCalculation_Bkup as aa,

    (Select T1.REgisterno,T2.Sgpa,T3.Cgpa From #temparrearTable1 T1

    Inner join #temparrearTable2 T2 on T1.Registerno=T2.Registerno

    Inner Join #temparrearTable3 T3 on T3.Registerno=T1.REgisterno) as a

    where

    aa.Registerno = a.REgisterno

  • RE: Urgent: Please Help me

    Hi,

    try with the below join

    ..

    ..

    ..

    DWT40034_BZL_VAT_TAX.ICMS_TAX as C17_ICMS_TAX,

    DWT40034_BZL_VAT_TAX.ICMS_ST_TAX as C18_ICMS_ST_TAX

    from DWB01002_GLOBAL_DW_EXTRACT.dbo.DWT40034_BZL_VAT_TAX as DWT40034_BZL_VAT_TAX

    inner join

    (

    select max(DWT40034_BZL_VAT_TAX.ROW_ID_NO)ROW_ID_NO, DWT40034_BZL_VAT_TAX.INTGRT_CNTRY_CD, DWT40034_BZL_VAT_TAX.ORD,

    DWT40034_BZL_VAT_TAX.ORD_LN,

    DWT40034_BZL_VAT_TAX.INTGRT_SRC_TRX_DT

    from dbo.DWT40034_BZL_VAT_TAX

    where DWT40034_BZL_VAT_TAX.ETL_PROC_STAT = 1

    group by DWT40034_BZL_VAT_TAX.INTGRT_CNTRY_CD, DWT40034_BZL_VAT_TAX.ORD,DWT40034_BZL_VAT_TAX.ORD_LN

    )as DWT40034_BZL_VAT_TAX_MAX

    on DWT40034_BZL_VAT_TAX.INTGRT_CNTRY_CD = DWT40034_BZL_VAT_TAX_MAX.INTGRT_CNTRY_CD

    and...

  • RE: Urgent: Please Help me

    Hi,

    What try to achieve?

    Actually am tried to solve the errors what you post the above,

    Ok, the retrieve data should be from DWT40034_BZL_VAT_TAX table for the max ROW_ID_NO, is...

  • RE: Urgent: Please Help me

    Hi,

    Message says the col5 name not specified.

    so try to name the column5 as below

    select max(col1)

    (

    select column1 as col1,

    column2 as col2,

    column3 as col3,

    column4 as col4,

    max(column5) /*here the problem that...

  • RE: Urgent: Please Help me

    Msg 8155, Level 16, State 2, Line 1

    No column was specified for column 5 of 'X'.

    Hi,

    Message say the column name not mentioned,

    SELECT max(DWT40034_BZL_VAT_TAX.ROW_ID_NO)

    from

    (

    select DWT40034_BZL_VAT_TAX.ROW_ID_NO, DWT40034_BZL_VAT_TAX.INTGRT_CNTRY_CD, DWT40034_BZL_VAT_TAX.ORD,

    DWT40034_BZL_VAT_TAX.ORD_LN,

    max(DWT40034_BZL_VAT_TAX.INTGRT_SRC_TRX_DT)INTGRT_SRC_TRX_DT...

  • RE: Urgent: Please Help me

    ..

    ..

    ..

    DWT40034_BZL_VAT_TAX.ICMS_TAX as C17_ICMS_TAX,

    DWT40034_BZL_VAT_TAX.ICMS_ST_TAX as C18_ICMS_ST_TAX

    from DWB01002_GLOBAL_DW_EXTRACT.dbo.DWT40034_BZL_VAT_TAX as DWT40034_BZL_VAT_TAX

    WHERE DWT40034_BZL_VAT_TAX.ROW_ID_NO IN

    (

    SELECT max(DWT40034_BZL_VAT_TAX.ROW_ID_NO)

    from

    (

    select DWT40034_BZL_VAT_TAX.ROW_ID_NO, DWT40034_BZL_VAT_TAX.INTGRT_CNTRY_CD, DWT40034_BZL_VAT_TAX.ORD,

    DWT40034_BZL_VAT_TAX.ORD_LN, max(DWT40034_BZL_VAT_TAX.INTGRT_SRC_TRX_DT)

    from dbo.DWT40034_BZL_VAT_TAX

    where DWT40034_BZL_VAT_TAX.ETL_PROC_STAT = 1

    group by DWT40034_BZL_VAT_TAX.ROW_ID_NO, DWT40034_BZL_VAT_TAX.INTGRT_CNTRY_CD, DWT40034_BZL_VAT_TAX.ORD,

    DWT40034_BZL_VAT_TAX.ORD_LN

    ) AS X

    )

  • RE: Problem in Building comma separated string for query result

    Hi,

    Instead of doing the separation, try with the dynamical execution.

    create table #temp

    (

    slno int,

    NAMES varchar(10)

    )

    insert into #temp

    select 1,'A'

    union all

    select 2,'AA'

    union all

    select 3,'AAA'

    union all

    select 4,'AAAA'

    declare @sql nvarchar(1000),

    @l_store_list varchar(50)

    set @l_store_list =...

Viewing 15 posts - 91 through 105 (of 568 total)