Image

Tutorial Mysql DB - Query select (order by, group by, limit)

Pada tutorial sebelumnya kita telah membahas Mysql Query select (all, distinct, alias, coalesce). Sekarang kita akan membahas tentang MySQL Query Select (order by, group by, dan limit).

1. Order by
Fungsi order by adalah untuk mengurutkan data kolom sebuah tabel. Pengurutan juga terbagi atas dua, Ascending (naik) dituliskan dengan ASC, dan Descending (turun) dituliskan dengan DESC. Yuk, langsung ke contoh saja biar bisa lebih paham.

select *from produk order by nama_produk ASC
Skrip diatas untuk mengurutkan nama_produk dari abjad A hingga Z.



select *from produk order by nama_produk DESC
Skrip diatas untuk mengurutkan nama_produk dari Z hingga A



order by juga bisa mengurutkan untuk angka. Skrip dibawah digunakan untuk menampilkan data produk dari harga yang terendah sampai yang tertinggi, ataupun sebaliknya.

select produk_id, barcode, brand, merk, harga_jual from produk order by harga_jual ASC;

select produk_id, barcode, brand, merk, harga_jual from produk order by harga_jual DESC;
Untuk memahami lebih lanjut, kita akan mencoba mengurutkan dengan dua parameter. Brand dan harga_jual.

select produk_id, barcode, brand, merk, harga_jual from produk order by brand,harga_jual ASC;

Pada kotak berwarna biru, karena brand INDOFOOD sama, maka harga_jual yang diurutkan dari kecil ke besar. Begitu juga pada brand KKB, makan harga_jual yang akan diurutkan.

2. Group by
Group by
berfungsi untuk mengelompokkan data yang sama dalam sebuah kolom yang ditunjuk. Jika didalam field yang ditunjuk data yang ingin ditampilkan sama, maka data yang ditampilkan hanyalah satu. Dari query yang terakhir diatas, bagaimana hasilnya jika kita coba untuk menambahkan query group by?

select produk_id, barcode, brand, merk, harga_jual from produk group by brand order by brand,harga_jual ASC

Dari hasil diatas, karena yang kita beri perintah dengan mengelompokkan field brand, maka field brand yang tertampil tidak ada yang sama.

3. Limit
Limit berfungsi untuk membatasi baris yang tertampil. Fungsi limit ini berfungsi ketika kita query select pada tabel dengan jumlah record yang sangat banyak. Misalkan jumlah data yang tersimpan sudah mencapai jutaan baris, kita perintahkan dengan query select *from jual_trans. Maka database akan sangat lama untuk memroses query tersebut. Bisa - bisa database kita hang. Nah, limit ini berfungsi untuk menyelesaikan masalah ini. Yuk, langsung ke contohnya

select produk_id, barcode, brand, merk, harga_jual from produk order by harga_jual DESC limit 10

Dari hasil diatas, kita perintahkan hanya 10 baris saja yang tertampil. Sedangkan kita kita ingin melanjutkan tampilan dari x sampai dengan x kita tinggal menambahkan koma (,).

select produk_id, barcode, brand, merk, harga_jual from produk order by harga_jual DESC limit 11,20

Karena jumlah query hanya 14 baris, maka yang ditampilkan dari 10 sampai dengan 20 adalah sebanyak empat baris. Demikian tutorial Mysql Query select (order by, group by, limit), semoga bermanfaat. Untuk tutorial selanjutnya kita akan membahas tentang Mysql Query SQL select (min, max, count, avg, sum).

Categories: Database

48 Comments

  • Image placeholder

    Sterling

    05-12-2026 00:24:25

    References: Payid minimum deposit pokies pbase.com

  • Image placeholder

    Morris

    04-12-2026 13:16:51

    References: Neosurf top up casino australia mapleprimes.com

  • Image placeholder

    Elouise

    04-12-2026 11:15:41

    References: Real money casino australia neosurf 1 dollar deposit casino neosurf australia

  • Image placeholder

    Ariel

    04-12-2026 08:56:26

    References: Neosurf accepted casinos australia https://md.chaosdorf.de/

  • Image placeholder

    Rochell

    03-12-2026 19:02:59

    References: Payid casino pokies https://dok.kompot.si/r7b1sX6uSCGLBZh4Zk8Rgg

  • Image placeholder

    Rae

    03-12-2026 00:05:43

    References: Trusted payid pokies australia doc.thudep.com

  • Image placeholder

    Giuseppe

    29-11-2026 22:14:36

    You’ll find that the "best bpay casino australia" listings are littered with marketing fluff promising "instant funding" while the actual transaction drags its feet for hours, sometimes days. Our team creates standard accounts, deposits real funds (AU$50–AU$200) via local methods like PayID or crypto, tests game volatility across 100+ pokie spins and table hands, and initiates withdrawals. It lets you self-exclude from all licensed Australian online and phone wagering providers in a single step, for periods from three months up to a lifetime. PWAs are common because many offshore casinos are not listed in Apple’s App Store or Google Play. Every casino on this list also runs on TLS/SSL encryption to protect your personal and payment data in transit, the same standard used by online banking. You’ll hardly see baccarat-specific bonuses in most casinos, but they’re usually included in live casino cashback offers which typically go as high as 25%.

  • Image placeholder

    Lashunda

    29-11-2026 21:00:32

    You can claim all sorts of bonuses, including reload bonuses, free spins and cashback. A document detailing the terms of use, fees, and other specifics about the prepaid card. Rolling Slots completes the five best $10 deposit bonus casino neosurf australia casinos Australia options with a focus on recurring rewards, cashback, and reload promotions.

  • Image placeholder

    Cedric

    28-11-2026 21:12:32

    Nevertheless, it’s an easy process that you can complete by following the simple steps outlined below. Great bank transfer casinos provide various communication channels for players to contact the support team. Our background checks also entail looking for safety features, including data encryption. The top bank transfer accepted casinos AU transfer casinos offer a smooth payment experience, providing one of the simplest banking methods for players.

  • Image placeholder

    Corey

    27-11-2026 22:29:50

    Since June 2024, licensed Australian wagering operators cannot accept deposits via credit cards or cryptocurrency. The bonus amount adds extra playing credit, while the free spins are typically allocated to popular slot titles, giving newcomers a chance to try the library with reduced personal risk. Payid Casino’s cashier supports a broad range of payment methods, from traditional credit cards to modern e-wallets and cryptocurrencies. The Payid Casino Games catalogue features titles spanning slots and live-casino formats, and a table outlines each game’s provider, listed RTP and game type. Payid Casino supports a range of payment methods, including those commonly used for Australian online transactions and digital payments. Thanks to technological advancements and modern payment methods like e-wallets and cryptocurrencies, payouts can now be completed on the same day.

  • Image placeholder

    Mira

    27-11-2026 22:11:36

    That’s how I tell if a site is a top PayID casino worth your time or just a pretty face that falls apart after launch. When I rank PayID online casino accepting payid sites, I don’t just take their word for it. Overall, PayID casinos in Australia are about speed, trust, and taking out the friction. All your transactions at Aussie PayID casinos are encrypted, you see everything in your bank statement, and it’s easy to keep track of your spending.

  • Image placeholder

    Davida

    27-11-2026 22:07:58

    Our site offers reviews and guides for entertainment purposes only. Although we try to present up-to-date reviews and offers from third-party sites, they may be subject to change. You send money straight from your bank account, so there’s no messing with cards, e wallets, or third parties. References: https://lab-ada.csciformazione.eu/

  • Image placeholder

    Carmine

    19-11-2026 13:27:18

    References: Payid direct bank transfer casino http://www.sg588.tw/home.php?mod=space&uid=1332379

  • Image placeholder

    Gretchen

    19-11-2026 09:56:22

    References: New payid casinos australia http://markdown.sakuragawa.moe/

  • Image placeholder

    Alyce

    19-11-2026 09:04:07

    References: Payid casino list cadetmove.ru

  • Image placeholder

    Staci

    19-11-2026 06:45:51

    References: Payid slot games zhujia.ca

  • Image placeholder

    Kaley

    18-11-2026 11:05:07

    References: Best payid pokies https://doks.komun.org/NPIEwukQQrGD3s5oGk2-lw

  • Image placeholder

    Zita

    17-11-2026 23:04:21

    References: Live casino payid downarchive.org

  • Image placeholder

    Vern

    17-11-2026 22:12:26

    References: Best payid gambling sites x.kongminghu.com

  • Image placeholder

    Emmett

    17-11-2026 20:07:24

    References: No verification payid casino australia zumpadpro.zum.de

  • Image placeholder

    Shana

    17-11-2026 19:16:12

    References: Payid accepted casinos sciencemission.com

  • Image placeholder

    Claudette

    17-11-2026 19:14:27

    References: Top 10 payid casinos australia https://bendsen-linnet.blogbright.net

  • Image placeholder

    Leta

    17-11-2026 18:53:32

    References: Casino online payid australia https://onlinevetjobs.com/author/trialbanker7/

  • Image placeholder
  • Image placeholder

    Lyle

    17-11-2026 12:50:12

    References: Payid gambling sites skyscrapperwiki.site

  • Image placeholder

    Dora

    17-11-2026 12:26:32

    References: Best payid casino australia http://l1ae1d.????????.??????/user/heatpint9/

  • Image placeholder

    Kirk

    17-11-2026 11:25:48

    References: Online gambling payid https://codimd.go.tulsacounty.org

  • Image placeholder

    Jocelyn

    17-11-2026 09:41:54

    References: Payid instant withdrawal pokies zumpadpro.zum.de

  • Image placeholder

    Aisha

    17-11-2026 05:06:24

    References: Best payid online casino http://ezproxy.cityu.edu.hk

  • Image placeholder

    Perry

    17-11-2026 04:22:00

    References: $20 payid deposit casino https://md.yeswiki.net/X5PfTwsNSU6vwV2k7_kGEQ

  • Image placeholder

    Staci

    17-11-2026 00:16:39

    References: Highest paying payid casino www.nongkhaempolice.com

  • Image placeholder

    Luca

    16-11-2026 23:08:13

    References: Kasyna visa 1v34.com

  • Image placeholder

    Eleanore

    16-11-2026 22:59:54

    References: $20 payid deposit casino bbs.88moli.top

  • Image placeholder

    Jolene

    16-11-2026 21:22:55

    References: Payid slot sites https://doks.komun.org

  • Image placeholder

    Alberto

    16-11-2026 20:56:15

    References: Payid withdrawal time casino www.tianjinzhaopin.cn

  • Image placeholder

    Aidan

    16-11-2026 18:07:33

    References: Payid casino bonus https://doc.anagora.org/

  • Image placeholder

    Kristie

    16-11-2026 17:58:42

    References: Online gambling payid https://onlinevetjobs.com/author/columnrubber3/

  • Image placeholder

    Elena

    16-11-2026 17:56:30

    References: Kasyno online na polskie pieni?dze karta gra na pieni?dze online wp?ata kart?

  • Image placeholder
  • Image placeholder

    Alexandria

    16-11-2026 16:14:38

    References: Recommended payid casinos https://md.interhacker.space

  • Image placeholder

    Margery

    16-11-2026 16:08:01

    References: Payid casino welcome bonus https://schoolido.lu/user/attackfired39/

  • Image placeholder

    Onita

    16-11-2026 09:27:43

    References: Payid casino login codimd.camba.coop

  • Image placeholder

    Raymundo

    16-11-2026 05:11:33

    References: New payid pokies https://pads.zapf.in/bx4uylXGQw-baakH5UE1og

  • Image placeholder

    Irwin

    15-11-2026 21:55:45

    References: Real money casino payid https://livebookmark.stream/story.php?title=payid-pokies-casinos-australia-2026-fast-payments-6

  • Image placeholder

    Jefferson

    15-11-2026 17:22:20

    References: Online gambling payid https://peatix.com/

  • Image placeholder

    Loren

    15-11-2026 06:57:52

    References: Payid casino real money https://gitlab.keysmith.bz/

  • Image placeholder

    augmentin idrar yolu enfeksiyonuna iyi gelirmi

    24-01-2025 14:45:27

    Glucocorticoids also are thought to inhibit the microsomal enzyme systems in the liver, theoretically delaying cyclophosphamide metabolism augmentin and lexapro

  • Image placeholder

    Jewspaway

    28-08-2024 10:42:58

    vilagra saw palmetto precum Given the strange process we have had in the House, I would support any fair and open process that gets us a bipartisan, comprehensive farm bill, Stabenow said better business bureau online pharmacy priligy

  • Leave a comment

Popular Posts

1

Hello World Java Android

2

Login App dengan Java Programming

3
4

See All Popular

Berlangganan Berita

Kami akan mengirim informasi - informasi terbaru sekitar teknologi dan pemrograman untuk menambah refenrensi anda untuk menjadi programmer handal. Masukkan email anda kolom sebelah ->