Jmelnick
Jmelnick

Reputation: 13

SQLite query only returning first record

I have created a members SQLite table that, when queried, only returns the first row. The table has 11 fields, most are TEXT and 9 and 10 are DATE. Here is a snapshot of the data:

https://i.sstatic.net/5NYqC.png

The following view query, along with many simpler variations of it, only returns the first record:

CREATE VIEW test_monthly_filter AS
    SELECT first_name,
           last_name,
           email,
           join_date,
           type_code,
           status,
           nac_num,
           nac_bill,
           change_date,
           comments
      FROM member
     WHERE status = 'A' OR 
           change_date = '10/15/18';

Any ideas on what is causing this? Thanks!

Upvotes: 0

Views: 1213

Answers (1)

David Milmont
David Milmont

Reputation: 91

You have data quality issues, if status = 'A' only returns one row, that means only one row satisfies the criteria of status = 'A'.

You can try something like:

WHERE status LIKE '%A%'

If that returns the rows you are interested in that means you probably have leading or trailing spaces.

Upvotes: 1

Related Questions