Friday, 14 May 2010

AS/400 create table as basics

Ok, syntax lesson for CREATE TABLE on AS/400 SQL.

    • create table TESTDTA.F55XOBJ AS
    • (SELECT ABOBJ, count(1) AS COUNT
    • FROM TESTDTA.F55SUM
    • GROUP BY ABOBJ
    • HAVING COUNT(1) > 1)
    • WITH DATA | WITH NO DATA

Job done.  Just remember to alias your aggregates and include the data statement at the end!

No comments:

Extending JDE to generative AI