update SQL returning subquery error

  • My apologies,

    I need to update the Create Table script so that the csv can be loaded into the table

    CREATE TABLE [dbo].[T_S_T_C_TEST](

    [sched_version] [tinyint] NOT NULL,

    [trip_id] [int] NOT NULL,

    [bs_seq] [smallint] NOT NULL,

    [bs_id] [int] NOT NULL,

    [new_stop_sequence] [int] NULL,

    [seq_num] [int] NULL,

    [eta] [datetime] NULL,

    [new_eta] [datetime] NULL,

    [DISTANCE] [float] NULL,

    [time_ratio_s] [float] NULL,

    [SUM_DISTANCE] [float] NULL,

    [RATIO_DISTANCE] [float] NULL,

    [Stop_Time] [datetime] NULL

    ) ON [PRIMARY]

  • First execute the select subquery and confirm whether you are getting desired resultset. Error describes itself that your subquery is returning more that one records.

    Let us know,

    Mahesh

    MH-09-AM-8694

  • I don't immediately see the problem - the MAX and MIN functions return a single value, right? but I would highlight and run each in turn and see if a single value results

    then highlight and run the inner SELECT and see if a single time results

    now if there are 2 or more records with the time that matches, maybe that's your problem...

Viewing 3 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply