Author Topic: SELECT ( @NORUT := @NORUT + 1 ) NORUT kenapa norut jadi tipe string?  (Read 176 times)

0 Members and 1 Guest are viewing this topic.

Offline abunuralif

  • Full Member
  • *
  • Posts: 52
sobat saya kadang merasa aneh , maklum newbie dalam mysql..
saya bikin query disini:
SELECT ( @NORUT := @NORUT + 1 ) NORUT, kode FROM stock a,(SELECT @NORUT := 0 ) VARIABLE_URUT

query diatas di laptop saya tipe norut bertipe numerik, tapi di komputer client ,kok jadi bernilai String...

kadang juga di laptop saya kalau pake AS, hasilnya jadi String..
misalnya:
select if(isnull(jml),0,a.jml) as jumlah from stock a

kenapa jumlah jadi tipe string


Offline poison

  • Hero Member
  • *
  • Posts: 1.624
  • Poison 4 Women
Re: SELECT ( @NORUT := @NORUT + 1 ) NORUT kenapa norut jadi tipe string?
« Reply #1 on: November 22, 2018, 06:18:03 PM »
yaaaa begitulah....coba pake cast
think BIG to get BIG thing

Offline abunuralif

  • Full Member
  • *
  • Posts: 52
Re: SELECT ( @NORUT := @NORUT + 1 ) NORUT kenapa norut jadi tipe string?
« Reply #2 on: November 22, 2018, 07:40:53 PM »
oh pengalamannya sama.. kirain ada kesalahan atau belum ada setting di sqlexec nya he he

Offline abunuralif

  • Full Member
  • *
  • Posts: 52
Re: SELECT ( @NORUT := @NORUT + 1 ) NORUT kenapa norut jadi tipe string?
« Reply #3 on: November 27, 2018, 09:15:44 AM »
alhamdulillah..
ternyata Msyql versi 5.0.37 , hasil dari query diatas hasil querynya bertipe string
kalau pake MariaDB 10.1.37, hasil query diatas hasilnya numeric

saya belum coba kalau pake msqyl 5.6 karena katanya MariaDB 10 ini sama dengan mysql versi 5.6


Offline Alidin

  • Junior Member
  • *
  • Posts: 120
Re: SELECT ( @NORUT := @NORUT + 1 ) NORUT kenapa norut jadi tipe string?
« Reply #4 on: December 03, 2018, 08:44:09 PM »
Kalau MySQL ver  8.0.13 ?

Offline abunuralif

  • Full Member
  • *
  • Posts: 52
Re: SELECT ( @NORUT := @NORUT + 1 ) NORUT kenapa norut jadi tipe string?
« Reply #5 on: December 08, 2018, 09:08:55 AM »
Mysql 8 belum coba...
menekuni mysql yang sudah berbayar jadi kurang semangat he he
fokus dulu ke MariaDB