In the database, what fields are generally used for the amount type, and money is used in actual use. Why is it so useful? Why not use float or decimal?
So we need to talk about the story behind them.
The decimal point of money is four digits, and it will be rounded off with a very small fraction after four digits, so it is suitable for the amount
High decimal precision, but small value range, better running speed than float, easier data processing than float, preferred use, suitable for finance, statistics
Float is an approximate value, but the data range is large. If the number is too large, you can only use this value to avoid using =,Because10.000000887788. the decimal point is a random number.
Corresponding to money in C #, decimal uses decimal, float uses double
Execute the following SQL statement to find the value of the auto-increment column corresponding to the newly inserted record. The key is @ identity.
Insert into tbldemo values ('test') Select @ identity