Marko
Marko

Reputation: 1

CROSS-JOIN not all rows in result

I am a beginner and I have this problem. I have two tables:

  1. date table
  2. a data table

I want to join all the rows from the first table with all the rows of the 2nd table ie cross join. After writing the code, unfortunately it does not show me all the date rows ie: 500 rows with the date 2024-06-24 and it jumps to 2024-07-02. what is the problem? My query:

    select
    *
    from dates as dt, tab2 as po
    WHERE 1=1 
        AND dt."Date" >= getdate()
        AND dt."Date" <= dateadd(day,60,getdate())

Upvotes: -1

Views: 51

Answers (1)

Marko
Marko

Reputation: 1

Order by would solve the problem - thanks. Note 1 = 1 is for my debuging.

Upvotes: 0

Related Questions