Hello.
> *nloc_num,ins_numero and ins_digi are decimal(3,0) You're using 1770 for comparison which is not in the type range. In my opinion, for incorrect data you may obtain incorrect answers. Luciano Centeno wrote: > hello, my friends, the query "option 1" return the right value, > the query "option 2" not. Why concat function make the difference? > > > *nloc_num,ins_numero and ins_digi are decimal(3,0) > > > > ///////////////////////////////////////////////////////// > option 1 .- > > select max(bi_num) as num > from b_inmuebles > where concat(nloc_num) =3D 1 and > concat(ins_numero)=3D 1770 and > concat(ins_digi)=3D 1 > > > return it 1 > > > ///////////////////////////////////////////////////////// > option 2 .- > > select max(bi_num) as num > from b_inmuebles > where nloc_num =3D 1 and > ins_numero=3D 1770 and > ins_digi=3D 1 > > return it NULL > -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.NET http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Gleb Paharenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]