[LUGOS] SQL string compare
Darko Dolinar
Darko.Dolinar at simobil.si
Thu Jan 22 10:13:23 CET 2004
tkole je pa na Oracle:
SQL> select 'krneki' from dual
2 where '15:00'<'6:00'
3 ;
'KRNEKI'
--------------------------------
krneki
SQL> select 'krneki' from dual
2 where '15:00'>'6:00'
3 ;
no rows selected
SQL> select 'krneki' from dual
2 where to_date('15:00','hh24:mi')>to_date('6:00','hh24:mi')
3 ;
'KRNEKI'
--------------------------------
krneki
SQL> select 'krneki' from dual
2 where to_date('15:00','hh24:mi')<to_date('6:00','hh24:mi')
3 ;
no rows selected
SQL>
lp, Dare
-----Original Message-----
From: Matjaz Prelog [mailto:rachek at occasio.si]
Sent: Thursday, January 22, 2004 9:07 AM
To: lugos-list at lugos.si
Subject: Re: [LUGOS] SQL string compare
Na MySQL-u se da, prav gotovo, ker jaz to delam z datumi pri enih svojih
obdelavah v PHPju in uporabljam DATE_FORMAT funkcijo
(`datumbook`>DATE_FORMAT(CONCAT(YEAR(NOW())-2,'-01','-01'),'%Y-%m-%d'). Ehm,
dalo bi se tudi z TIME_FORMAT, ker funkcija ti vrne vrednost, ki ga mysql
obravnava kot time, ne kot string. Precitaj si
http://www.mysql.com/doc/en/Date_and_time_functions.html in veselo na delo.
Ce pa ne gre, pa pisi na privat. ;)
LP, rach.
P.S.: Moralo bi se dati tudi na drugih "resnih" SQLih, kaksen "dumb" TPS
ODBC gonilnik (Clarion) ti tega *nikoli* ne bo obdelal.
----- Original Message -----
From: "Robert Ludvik" <robert.ludvik at zd-lj.si>
To: <lugos-list at lugos.si>
Sent: Wednesday, January 21, 2004 2:46 PM
Subject: [LUGOS] SQL string compare
> Zdravo
> Kako prepricam sql stavek, da bo 'pravilno' primerjal dva stringa, ki
> pomenita uro:
> '15:00' je manjse od '6:00', rad pa bi, da bi znal povedati, da je
> vecje. se da?
>
> --
> Robert Ludvik
>
>
>
More information about the lugos-list
mailing list