-3

I guess the correct way of truncating a value in MySQL is truncate(value,limit); but that doesn't seem to be working here it needs an extra table name;

select truncate(94204.27348,2);

ERROR at line1:
ORA-00923: FROM keyword not found where expected

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786

2 Answers2

0

In Mysql You should use round. Truncating table will remove the data from the table and reset all your auto increment values.

SELECT ROUND(94204.27348,2);

Result - 94204.27

This will round the value and display only two decimal places.

Buddhika
  • 163
  • 1
  • 7
0

Assuming you are using Oracle, you must supply a table reference on your select query.

Oracle select queries require a table reference always.

You can do this....

Select truncate(94204.27348,2)  -- see further comment below
From dual
;

Dual is a special table that allows these sort of queries.

Also, I think you might mean to use the TRUNC function.

As others have pointed out, the TRUNCATE query is not quite the same, it will erase the contents of the table that you supply it.

GMc
  • 1,764
  • 1
  • 8
  • 26