Fetching unexpected results from WHRE clause with bpchar and character varying fields

I am new to PostgreSQL. Trying to understand the reason for erroneous results and would like to learn how to rectify it.
I have a students table. When I execute the query

SELECT stud_id, batch_type, subject, jdate ,subj_id, sdtime, subj_hours
FROM studs 
ORDER BY jdate DESC, subject DESC, stud_id ASC
LIMIT 15 OFFSET 0

I get the following correct result as expected:

Stud_id bpchar Batch_typeCharacter varying SubjectCharacter varying Jdatedate Subj_idinteger SdtimeTimestamp without time zone Subj_hoursinteger
3591f1gff960h09l Residential Software Systems Development 7 null 35 2024-03-20 12:42:55.040189 10
983e292ce1xy69c0 Residential Software Systems Development 5 null 35 2024-03-20 12:42:55.040189 14
7k992ad576842507 Residential Software Systems Development 4 null 35 2024-03-20 12:42:55.040189 12
b9ahibji8jgaeth2 Residential Software Systems Development 3 null 35 2024-03-20 12:42:55.040189 10
5758uh95376eb0b4 Residential Software Systems Development 2 2024-03-20 35 2024-03-20 12:42:55.040189 12
6ch9b2f7894740er Residential Software Systems Development 2024-03-20 35 2024-03-20 12:42:55.040189 14
a877450586v3869h Residential Software Systems Development 2024-03-20 35 2024-03-20 12:42:55.040189 14
78635a8s1586d95c Residential Software Systems Development 2024-03-15 35 2024-03-20 12:42:55.040189 14
b58c7fbf57328468 Residential Software Systems Development 2024-03-15 35 2024-03-20 12:42:55.040189 16
acb8g94351e84226 Residential Software Systems Development 2024-02-25 35 2024-03-20 12:42:55.040189 15
fvhud7653fd85m1s Residential Software Systems Development 2024-02-20 35 2024-03-20 12:42:55.040189 16
b7hf962ffb6he96j Residential Design and Technology 2024-02-19 35 2024-03-20 12:42:55.040189 14
394ij84275c6e97d Residential Software Systems Development 2024-01-15 35 2024-03-20 12:42:55.040189 16

When I try filter the results by adding WHERE condition in the query as below:

SELECT stud_id, batch_type, subject, jdate ,subj_id, sdtime, subj_hours form studs
WHERE subject < ’ Software Systems Development 5’
AND stud_id > ‘983e292ce1xy69c0’
ORDER BY join_date DESC, subject DESC, stud_id ASC
LIMIT 15 OFFSET 0

I get erroneous result as follows:

Stud_idbpchar Batch_typeCharacter varying SubjectCharacter varying Jdatedate Subj_idinteger SdtimeTimestamp without time zone Subj_hoursinteger
b9ahibji8jgaeth2 Residential Software Systems Development 3 null 35 2024-03-20 12:42:55.040189 10
a877450586v3869h Residential Software Systems Development 2024-03-20 35 2024-03-20 12:42:55.040189 14
b58c7fbf57328468 Residential Software Systems Development 2024-03-15 35 2024-03-20 12:42:55.040189 16
acb8g94351e84226 Residential Software Systems Development 2024-02-25 35 2024-03-20 12:42:55.040189 15
fvhud7653fd85m1s Residential Software Systems Development 2024-02-20 35 2024-03-20 12:42:55.040189 16
b7hf962ffb6he96j Residential Design and Technology 2024-02-19 35 2024-03-20 12:42:55.040189 14

but I was expecting the following result:

Stud_idbpchar Batch_typeCharacter varying SubjectCharacter varying Jdatedate Subj_idinteger SdtimeTimestamp without time zone Subj_hoursinteger
7k992ad576842507 Residential Software Systems Development 4 null 35 2024-03-20 12:42:55.040189 12
b9ahibji8jgaeth2 Residential Software Systems Development 3 null 35 2024-03-20 12:42:55.040189 10
5758uh95376eb0b4 Residential Software Systems Development 2 2024-03-20 35 2024-03-20 12:42:55.040189 12
6ch9b2f7894740er Residential Software Systems Development 2024-03-20 35 2024-03-20 12:42:55.040189 14
a877450586v3869h Residential Software Systems Development 2024-03-20 35 2024-03-20 12:42:55.040189 14
78635a8s1586d95c Residential Software Systems Development 2024-03-15 35 2024-03-20 12:42:55.040189 14
b58c7fbf57328468 Residential Software Systems Development 2024-03-15 35 2024-03-20 12:42:55.040189 16
acb8g94351e84226 Residential Software Systems Development 2024-02-25 35 2024-03-20 12:42:55.040189 15
fvhud7653fd85m1s Residential Software Systems Development 2024-02-20 35 2024-03-20 12:42:55.040189 16
b7hf962ffb6he96j Residential Design and Technology 2024-02-19 35 2024-03-20 12:42:55.040189 14
394ij84275c6e97d Residential Software Systems Development 2024-01-15 35 2024-03-20 12:42:55.040189 16

Some rows are missed in the result. Can someone help me to understand the reason and how to fix it?

New contributor

qquest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật