#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    1
    Rep Power
    0

    Insert data into a table with function


    I am trying to insert data in to a table.
    when I run the select statement the data result is correct.
    but when i try to insert into a table it adds null.
    see sql statement
    'insert into nwSTKDETtemp ( SEASON, STYLECODE, COLOUR,
    QTY1, QTY2, QTY3)
    select SEASON, STYLECODE, COLOUR, sum(qTY1), sum(qTY2), sum(qTY3) from nwstkdet
    where transcode='INV'
    group by season,stylecode,colour'

    i am using firebird 1.55
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    19
    Rep Power
    0
    I would suspect that you have a null record somewhere. The easiest way to omit null is to add it to the where clause or else a having clause (having season is not null)

IMN logo majestic logo threadwatch logo seochat tools logo