(25-04-2022, Saat: 15:25)cinarbil Adlı Kullanıcıdan Alıntı: [ -> ] (25-04-2022, Saat: 13:17)OZCANK Adlı Kullanıcıdan Alıntı: [ -> ]Arkadaşlar merhaba; Bir sorunum var yardımcı olursanız sevinirim.
SQL ile DBGrid1 liste alıyorum kolaylık açısından aynı BELGE_NO dan sonra boşluk atmasını nasıl sağlarım?
Bu şekilde Liste;
000000000041407
000000000041407
000000000041407
000000000041407
000000000041408
000000000041408
000000000041408
000000000041409
000000000041410
000000000041410
Bu şekilde Olmasını istiyorum;
000000000041407
000000000041407
000000000041407
000000000041407
000000000041408
000000000041408
000000000041408
000000000041409
000000000041410
000000000041410
Dbgrid' de böyle bir özellik var mı bilmiyorum ama ben olsam nasıl yapardım ?
dbgrid onDrawCell özelliğine
eğer grid ilk satırı değilse ve eklenen satır belge no bir önceki satırdaki belge no ile eşit değilse grid satır yüksekliği 20 yoksa 15 (default yükseklik neyse o değer) yapardım
veya aynı karşılaştırmada renkleri değiştirirdim.
Ben şöyle bir kod buldum uyarladım ama renklendirme yapmadı.
if StokKontrol.FieldByName('FISNO').AsString = DBGrid3.DataSource.DataSet.FieldByName('FISNO').AsString Then
begin
DBGrid3.Canvas.Font.Color:=clWhite;
DBGrid3.Canvas.Brush.Color:=clBlack;
end;
if DataCol = 0 then
DBGrid3.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
(26-04-2022, Saat: 09:14)hi_selamlar Adlı Kullanıcıdan Alıntı: [ -> ] (25-04-2022, Saat: 13:17)OZCANK Adlı Kullanıcıdan Alıntı: [ -> ]Arkadaşlar merhaba; Bir sorunum var yardımcı olursanız sevinirim.
SQL ile DBGrid1 liste alıyorum kolaylık açısından aynı BELGE_NO dan sonra boşluk atmasını nasıl sağlarım?
Bu şekilde Liste;
000000000041407
000000000041407
000000000041407
000000000041407
000000000041408
000000000041408
000000000041408
000000000041409
000000000041410
000000000041410
Bu şekilde Olmasını istiyorum;
000000000041407
000000000041407
000000000041407
000000000041407
000000000041408
000000000041408
000000000041408
000000000041409
000000000041410
000000000041410
Merhabalar,
Umarım yardımcı olur.
https://www.db-fiddle.com/f/gTA8wWrZ8h278FhkxpWE5N/0
Kolay gelsin.
cREATE TABLE IF NOT EXISTS deneme (
id INT AUTO_INCREMENT PRIMARY KEY,
belge_no VARCHAR(255) NOT NULL
) ENGINE=INNODB;
insert into deneme (belge_no) values ('ABC123'),('ABC123'),('ABC124'),('ABC125'),('ABC125');
SELECT
case id is not null when true then id else null end as id,
case id is not null when true then belge_no else null end as belge_no
FROM deneme
group by belge_no, id
with rollup
having belge_no is not null
Teşekkür ederim. Uyarlayıp kullandım ama hata veriyor
SELECT
case STOK_KODU IS NOT NULL when true then STOK_KODU else null end as STOK_KODU,
case STOK_KODU IS NOT NULL when true then FISNO else null end as FISNO
FROM TBLSTHAR
group by FISNO, STOK_KODU
with rollup
having FISNO is not null
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'IS'.
Msg 319, Level 15, State 1, Line 8
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.