Row ပေါင်းများစွာ

ဒီနေ့ Database ထဲက Row ပေါင်း ၇ သောင်းလောက် ကို ဘယ်လို Display ပြရင်ကောင်းမလဲဆိုတာ စဉ်းစားမိတယ်။ အခု လုပ်နေတဲ့ Project က row ပေါင်း ၇ သောင်းကျော်မယ်တဲ့။ အခုစမ်းနေတာ ၂၀၀၀ လောက်တင် Datagridview မှာ သိပ်အဆင်မပြေဘူး။ နောက်တော့ web မှာလို page တွေ ခွဲထုတ်ဖို့ ဆုံးဖြတ်လိုက်တယ်။ Access မှာတော့ MySQL Limit မရှိဘူး။ wiki ((http://en.wikipedia.org/wiki/Select_(SQL)#Limiting_result_rows)) အကူအညီနဲ့ Top နဲ့ လုပ်ရတယ် ဆိုတာ သိသွားတယ်။

Access မှာ
page 1 မှာ ၅၀ ပြပြီးသွားရင် page 2 ကို
select top 50 * from table where ID Not IN (select top 50 * from table)

အဲလိုလေး ပြန်ထိန်းရတယ်။ နောက်ကတော့ where နဲ့ filter ပြန်လုပ်ရတယ်။ ပါပြီးသား ID တွေ မဟုတ်တာဆိုပြီး ရွေးထုတ်လိုက်တဲ့ ပုံလေးပေါ့။ page ခွဲပုံ idea ကိုတော့

http://code.mysteryzillion.org/article/separate-page-from-row-record

မှာ ဖတ်နိုင်ပါတယ်။ ကျွန်တော်တို့တွေအနေနဲ့ record တွေများလာလေလေ… အများကြီးကို တစ်ခါတည်း တန်းမပြပဲ page လေးတွေ ခွဲလိုက်ခြင်းဟာ အသုံးပြုသူအတွက် တော်တော်အဆင်ပြေစေပါတယ်။ Memory သုံးတာ တော်တော်သက်သာသွားတယ်။ Database သုံးတာ တော်တော်သက်သာသွားတယ်။ အခုတော့ အဆင်ပြေသွားပါပြီဗျာ။

One response to “Row ပေါင်းများစွာ”

  1. MZ မှာ ကျွန်တော်လဲ ရေးထားတာ တစ်ခုရှိသေးတယ်ဗျ။ Custom Paging with SQL Storedprocedure ဆိုပြီးတော့။

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Saturngod

Subscribe now to keep reading and get access to the full archive.

Continue reading