Thuta Learning
ရှာဖွေရန်
BasicData & Databasesbeginner

WHERE Clause

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

WHERE clause က data တွေထဲက ကိုယ်လိုချင်တဲ့ rows ကိုပဲစစ်ထုတ်ပေးပါတယ်။ Search, filter, admin report, user dashboard တွေမှာ အမြဲနီးပါးသုံးရတဲ့ concept ပါ။

Comparison operators

= တူညီသောတန်ဖိုး

!= သို့မဟုတ် <> မတူသောတန်ဖိုး

>, <, >=, <= အကြီး/အသေးနှိုင်းယှဉ်ရန်

သတိထားရန်

Text value ကို quote ထည့်ပါ။ ဥပမာ Country = 'Mexico'

sql
SELECT CustomerName, Country
FROM Customers
WHERE Country = 'Mexico';
You should see
+----------------+---------+ | CustomerName | Country | +----------------+---------+ | Ana Trujillo | Mexico | | Antonio Moreno | Mexico | +----------------+---------+ What learners should notice: Table ထဲမှာ customer ၄ ယောက်ရှိပေမဲ့ condition ကိုက်တဲ့ Mexico customer ၂ ယောက်ပဲထွက်လာပါတယ်။ Practical use: Ecommerce site မှာ WHERE category = 'Laptop' လို့သုံးပြီး laptop product တွေကိုပဲပြနိုင်ပါတယ်။
WHERE Clause | Thuta Learning