Tolong pilih kategori sesuai, jenis posting (pertanyaan atau bukan) dan sertakan tag/topik yang sesuai misal komputer, php, mysql, dll.
Promosi atau posting tidak pada tempatnya akan kami hapus.
Mencantumkan kode program di posting Anda, tolong ikuti aturan yang sesuai, baca http://diskusiweb.com/discussion/39204/aturan-cara-menyisipkan-kode-program-di-diskusiweb

Baca cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

Help the GROUP BY clause or be used in an aggregate function

mhn bantuannya untuk group by query

jika query seperti ini

SELECT d.id_d as id, d.id_vendor as id_vendor, d.keterangan as keterangan, d.file as file, d.tanggal as tgl, d.dokumen_status as status, t.no_bmp as no_bmp FROM public.dokumen d left join public.ikut_tender t on d.id_vendor=t.id_vendor where d.id_vendor='1486913610' AND d.keterangan='rencana_pengiriman' group by d.id_d

jika pakai query diatas ERROR: column "t.no_bmp" must appear in the GROUP BY clause or be used in an aggregate function

jika query seperti ini

SELECT d.id_d as id, d.id_vendor as id_vendor, d.keterangan as keterangan, d.file as file, d.tanggal as tgl, d.dokumen_status as status, t.no_bmp as no_bmp FROM public.dokumen d left join public.ikut_tender t on d.id_vendor=t.id_vendor where d.id_vendor='1486913610' AND d.keterangan='rencana_pengiriman' group by t.no_bmp, d.id_vendor, d.id_d

itu kenapa tampilnya ada dua record ..

ini contoh tabelnya, terimaksih....

https://s8.postimg.org/ombbikvs5/bahan.png

Tanggapan

  • ya no_bmp nya beda... jadi walopun di group ya pasti keluar 2...
Sign In or Register to comment.