Forum Replies Created

Viewing 15 posts - 7,816 through 7,830 (of 10,144 total)

  • RE: Split table on columns into two tables.

    Nice 🙂

    Laying out the table structures and the insert statements has encouraged you to do almost all of the work.

    You could answer question 1 like this:

    -- problem 1 "...

  • RE: Cross Referencing Tables

    Two different solutions.

    -- query 1

    SELECT o.id, o.first, o.last, o.person_id, o.id_master

    FROM (

    SELECT d.id, d.first, d.last, d.person_id, d.id_master,

    x = COUNT(*) OVER (PARTITION BY d.person_id)

    FROM #duplicates d

    INNER JOIN #blacklist...

  • RE: Split table on columns into two tables.

    Please provide scripts to create all three tables and populate the source table with data.

  • RE: insert table error

    CREATE TABLE ##a(id int identity(0,2))

    INSERT INTO ##a DEFAULT VALUES

    INSERT INTO ##a DEFAULT VALUES

    INSERT INTO ##a DEFAULT VALUES

    INSERT INTO ##a DEFAULT VALUES

    SELECT * FROM ##a

  • RE: Help with a weird query

    Matt Mitchell (6/13/2010)


    Matt Mitchell (6/12/2010)


    Gets my vote!

    The question does highlight thebenegits of stating the problem in English though.

    and also the benefits of reading what you've put before posting!

    Lol!

    Shame the...

  • RE: Sorting non sequence

    The sample data is a little late but never mind - what are the column names?

  • RE: Help with a weird query

    lart.expert (6/11/2010)


    Is it me, or does this look like a homework question?

    Unlikely as OP has been a forum member for over two years.

  • RE: Help with a weird query

    DROP TABLE #test

    CREATE TABLE #test

    (

    IdX INT,

    IdY INT,

    ...

  • RE: Sorting non sequence

    DROP TABLE #Table

    CREATE TABLE #Table (A INTEGER)

    INSERT INTO #Table (A)

    SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4

    SELECT *

    FROM #Table

    ORDER BY

    CASE

    WHEN A...

  • RE: Are the posted questions getting worse?

    skcadavre (6/8/2010)


    Anyone understand what is being asked here? I've spent as long as I want to trying to figure out what he actually wants. We now have sample data...

  • RE: What Will We Take For Granted Tomorrow?

    GilaMonster (6/8/2010)


    Scott-144766 (6/7/2010)


    Sadly, tuberculosis isn't a thing of the past like smallpox. It infects a third of the world's population and kills over a million people a year.

    In some parts...

  • RE: HOW To write this query?

    If you have to aggregate your results, and I'm sure you do given the number of rows you're processing, then GROUP BY is almost certainly the fastest way to do...

  • RE: Today's Random Word!

    tosscrosby (6/8/2010)


    mbricker-600840 (6/8/2010)


    Whirligig

    Did you know they could be "hand or friction" powered? :w00t: I don't even want to know......

    Hand or friction powered aquatic beetle?

  • RE: Read column values character by character in SQL query

    Gopi Muluka (6/8/2010)


    CHECK THIS

    DECLARE @Table1 TABLE (ID INT , Employee VARCHAR(50))

    DECLARE @Table2 TABLE (SourceFieldChar CHAR(1),Val CHAR(1) )

    INSERT INTO @Table1

    SELECT 1,'Ritesh' UNION ALL

    SELECT 2, 'Bhatt'

    INSERT INTO @Table2

    SELECT 'R','X' UNION ALL

    SELECT 'i',...

  • RE: best query to get data from multiple tables

    The best way? Impossible to tell from what you've provided. Which output columns do you want, and from which tables? Build a SELECT...FROM...with a modest restriction and test it. Look...

Viewing 15 posts - 7,816 through 7,830 (of 10,144 total)