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

LIKE Operator

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

LIKE ကို text pattern ရှာဖို့သုံးပါတယ်။ Search feature အခြေခံတည်ဆောက်ရာမှာ အလွန်အသုံးများပါတယ်။

% — စာလုံး ၀ လုံး၊ ၁ လုံး၊ အများကြီး ကိုယ်စားပြုနိုင်သည်

_ — စာလုံးတစ်လုံးတိတိ ကိုယ်စားပြုသည်

Pattern examples

'A%' = A နဲ့စသော text

'%son' = son နဲ့ဆုံးသော text

'%market%' = market ပါသော text

sql
SELECT CustomerName, Country
FROM Customers
WHERE CustomerName LIKE 'A%';
You should see
+--------------------+---------+ | CustomerName | Country | +--------------------+---------+ | Alfreds Futterkiste| Germany | | Ana Trujillo | Mexico | | Antonio Moreno | Mexico | | Around the Horn | UK | +--------------------+---------+ What this code does: CustomerName က A နဲ့စတဲ့ rows တွေကိုရှာပါတယ်။ Practical version: Product search မှာ WHERE ProductName LIKE '%phone%' လို့သုံးပြီး phone ပါတဲ့ products တွေကိုရှာနိုင်ပါတယ်။
LIKE Operator | Thuta Learning