SELECT [e]+[f] AS masuk, [h]+[i] AS keluar, * FROM kegiatan_2kas WHERE a Like '2.2.1.*.*' And key=2012 ORDER BY b;
Jumat, 03 April 2015
Sub Total in Each Row
Order By Split Column
I have a column call it id:
4.1.2.10.0
4.1.2.3.0
4.1.2.4.0
6.1.20.0.0
6.1.3.0.0
...
etc...
What I'd like to do is include an ORDER BY statement that splits the string, to become like this:
4.1.2.3.0
4.1.2.4.0
4.1.2.10.0
6.1.3.0.0
6.1.20.0.0
...
etc....
you should do
select *
from tbl
order by CInt(mid(field1,1,instr(1,field1,'.')-1)),
CInt(mid(field1,instr(1,field1,'.')+1,instr(2,field1,'.')-1)),
CInt(mid(field1,instr(3,field1,'.')+1,instr(4,field1,'.')-1)),
CInt(mid(field1,instr(5,field1,'.')+1,instr(6,field1,'.')-1))
src https://stackoverflow.com/questions/28934055/order-by-split-column
Langganan:
Postingan (Atom)
-
a < script > /** * sends a request to the specified url from a form. this will change the window location. * @param {string} path th...
-
function popup ( idbrg ){ $.ajax({ type : 'POST', url : '?plain=app/barang-harga.php...
-
Mount Storage opkg update opkg install kmod-usb-storage block-mount block-hotplug kmod-fs-ext4 kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso885...