PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, August 10, 2022

[FIXED] how to get number locate at 2 place before decimal point?

 August 10, 2022     decimal, decimal-point, mysql, sql     No comments   

Issue

example: i have a number=143.42 , i want to get "4" which is locate 2 place before decimal point. what SQL command should i use? i still new in SQL, don't roast me too hard.


Solution

You could do it with some simple math

SELECT 143.42 div 10 % 10;

SQL Fiddle



Answered By - Diadistis
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing