Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: newton binomial coefficient

Re: newton binomial coefficient

From: byrmol <member27348_at_dbforums.com>
Date: Wed, 02 Apr 2003 05:21:34 +0000
Message-ID: <2718417.1049260894@dbforums.com>

CREATE TABLE Things(Thing varchar(20) NOT NULL Primary Key)

INSERT INTO Things (Thing)

        SELECT 'car' AS Thing
        UNION ALL
        SELECT 'home'
        UNION ALL
        SELECT 'dog'
        UNION ALL
        SELECT 'woman'

SELECT MIN(T.Thing + ' ' + X.Thing) as NewThing FROM Things AS T CROSS JOIN Things AS X
WHERE T.Thing != X.Thing
GROUP BY CASE WHEN T.THING > X.THING THEN T.Thing + X.Thing ELSE X.Thing + T.Thing END

It works in SQL Server 2K.......

--
Posted via http://dbforums.com
Received on Tue Apr 01 2003 - 23:21:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US