การใช้งานหลักของฉันคือทำให้ง่ายขึ้นที่จะแสดงความคิดเห็นสิ่งต่าง ๆ ในระหว่างการพัฒนาของแบบสอบถาม ฉันเป็นผู้นำด้วย,
's และand
' s:
SELECT
A
-- ,B
,C
,D
-- ,E
FROM TABLE
WHERE 1=1
-- and B='This'
and C='That'
-- and D is not null
นอกจากนี้ยังช่วยให้ง่ายขึ้นในการเปลี่ยนสิ่งต่าง ๆ โดยทางโปรแกรมไว้จนจบ
this = "SELECT * "
this += "FROM TABLE "
this += "WHERE 1=1 "
if user chooses option a then this += "and A is not null "
if user chooses option b then this += "and B is not null "
if user chooses option b then this += "and C is not null "
if user chooses option b then this += "and D is not null "
มิฉะนั้นคุณจะต้องผ่านคุณสมบัติตัวเลือกแรก ... และให้แต่ละตัวเลือกต่อไปนี้ตรวจสอบตัวเลือกก่อนหน้า เกิดอะไรขึ้นถ้าผู้ใช้เลือกตัวเลือก D ในตัวอย่างก่อนหน้านี้? คุณต้องตรวจสอบให้แน่ใจว่าif A, B and C aren't chosen
ใช้WHERE
อย่างอื่นand
แล้ว เมื่อ=
เริ่มต้นคุณสามารถตบตัวระบุไปยังท้ายคำสั่งได้