Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)

  • RE: SQL optimization

    Use left outer join, and filter out the match pairs

    select t1.* from tab1 t1

    left outer join tab2 t2 on t2.ID=t1.ID

    where t2.ID is null

    Hope this would help

    Thanx

     

  • RE: Export To Excel

    What version of Excel are you using? Its requirement is Excel 2002 or higher.

    Here is the excerpt from RS Books Online

    ms-help://MS.RSBOL80.1033/RSMAIN/htm/rsc_architecture_v1_01df.htm

    Excel Rendering Extension

    The Excel rendering extension renders reports that can...

  • RE: Cursor

    I utilize primary key to avoid using cursor assuming you have such primary key. Here it is:

     

    declare @db table(
        Customer char(1),
        SalesAmount numeric,
     ...
  • RE: when not to use *= for joins

    I do know whether this more acceptable, but you can do like this

    SELECT * FROM @order x LEFT JOIN @orderdetail y ON order_ID = orderdetail_order_IDwhere isnull(y.orderdetail_ID,1) = 1;

    Thanx

     

  • RE: when not to use *= for joins

    I do know whether this more acceptable, but you can do like this

    SELECT * FROM @order x LEFT JOIN @orderdetail y ON order_ID = orderdetail_order_IDwhere isnull(y.orderdetail_ID,1) = 1;
  • RE: SQL 92 statement

    The equivalent SQL 92 statement would be

    select * from (select *     from authors a,titles ta) z left outer join titleauthor ta on ta.title_id=z.title_id and ta.au_id=z.au_id

    If the...

  • RE: compare lastyear vs. thisyear SQL

    Try this:

    SELECT ISNULL(a.itemno,b.itemno) AS itemno,

    ISNULL(a.qty2003, 0) AS qty2003,

    ISNULL(a.sales2003, 0) AS sales2003,

    ISNULL(b.qty2002, 0) AS qty2002,

    ISNULL(b.sales2002, 0) AS sales2002,

    ISNULL(a.sales2003, 0)-ISNULL(b.sales2002, 0) AS sales$difference,

    ISNULL(a.sales$var,0) AS sales$var

    FROM (

        SELECT itemno, SUM(qty) AS qty2003, SUM(sales)...

Viewing 7 posts - 1 through 7 (of 7 total)