Forum Replies Created

Viewing 15 posts - 526 through 540 (of 557 total)

  • RE: Puzzle : Generating two unique numbers from an array of numbers (repetation not allowed)

    Cadavre (9/17/2012)

    So the fastest ones after one run are: -

    ScottPletcher: 0ms

    Cadavre: 3ms

    ChrisM@Work: 4ms

    Eugene Elutin: 5ms

    Dwain: 7ms

    Eugene Elutin: 11ms

    Personally, I'd call those times equivalent. I suspect that the fastest one would...

  • RE: Puzzle : Generating two unique numbers from an array of numbers (repetation not allowed)

    Another solution, I think shorter and more efficient, this because only 865 rows need to be generated and inspected.

    with a as ( select 123 as n union all select...

  • RE: Difference between a CROSS JOIN and a 'comma'

    GSquared (9/14/2012)


    Gazareth (9/14/2012)


    They are equivalent, but I don't think you can mix the two types of join in the same query.

    That means the two are not semantically identical in the...

  • RE: Difference between a CROSS JOIN and a 'comma'

    Lowell (9/14/2012)


    yes it's true; there are two ways to cross join tables.

    I do realize that there a two ways for the cross join. And I know that the comma syntax...

  • RE: SQL taking long time

    subbareddy542 (9/14/2012)


    please use #temp table in plase of CTE.

    Please explain why a #temp table should be used.

    I have been using CTE expressions and used #temp tables to 'force' the...

  • RE: Check room availability in hotel system

    Overlapping of times.

    The overlapping of times is often handled wrong.

    Suppose we have a table with booked_start and booked_finish.

    And you have a begintime and endtime for which you want the 'overlapping'...

  • RE: Transparent partitioning.

    HowardW (8/23/2012)


    :

    The point of partitioning is normally to divide your tables using a natural key, like a transaction date, or a month end date etc. in order to immediately narrow...

  • RE: sql query prob

    Sorry for the repeats. Ben

  • RE: sql query prob

    CREATE TABLE tablename

    (

    id int NULL,

    name varchar(50) NULL,

    val int NULL

    )

    insert into tablename VALUES (1 ,'abc' ,100)

    insert into tablename VALUES (2 ,'ravi' ,null)

    insert into tablename VALUES ('','venu' ,200)

    insert into tablename VALUES (3...

  • RE: sql query prob

    CREATE TABLE tablename

    (

    id int NULL,

    name varchar(50) NULL,

    val int NULL

    )

    insert into tablename VALUES (1 ,'abc' ,100)

    insert into tablename VALUES (2 ,'ravi' ,null)

    insert into tablename VALUES ('','venu' ,200)

    insert into tablename VALUES (3...

  • RE: sql query prob

    CREATE TABLE tablename

    (

    id int NULL,

    name varchar(50) NULL,

    val int NULL

    )

    insert into tablename VALUES (1 ,'abc' ,100)

    insert into tablename VALUES (2 ,'ravi' ,null)

    insert into tablename VALUES ('','venu' ,200)

    insert into tablename VALUES (3...

  • RE: sql query prob

    id int,

    name varchar(50),

    sal int

    With the above datatypes you can not have a table:

    ,venu ,200

    null,fanu ,3600

    If the id is an int you can not have both a NULL value and a...

  • RE: PATINDEX to split a column into multiple columns

    I am doing this out of the top of my head and haven't tried this code, but something like :

    change:

    set int1 = SUBSTRING (interests,1,PATINDEX ('%,%',interests));

    To:

    set int1 = SUBSTRING (interests+',empty,empty,empty,empty',1,PATINDEX ('%,%',interests+',empty,empty,empty,empty'));

    I...

  • RE: Clustered Key. (Making it unique).

    Suresh B. (8/20/2012)


    Yes. It is still valid.

    It's caled uniquifier.

    Thank you,

    Using the term uniquifier, on line I found:

    [/url]

    In books online I could not find the term uniquifier, neither could I...

  • RE: Indexes.

    GilaMonster (6/29/2012)


    Some behaviour likely changed between SQL 6.5 and SQL 7. Nothing more recent than that though.

    WHERE Column IN ('Value1') is completely equivalent to WHERE Column = 'Value1' and WHERE...

Viewing 15 posts - 526 through 540 (of 557 total)