MySQL converting MAC Address to a Number
Writing by shivdev on Friday, 2 of December , 2011 at 12:36 am
Here’s an example of converting a Mac Address 01:23:45:67:89:ab into a decimal number (1250999896491), using the MySQL conv() function.
The idea is select CONV(‘0123456789ab’, 16, 10); — 01:23:45:67:89:ab without the :
select CONV(REPLACE(SUBSTR(’01:23:45:67:89:ab’, INSTR(’01:23:45:67:89:ab’, ‘(‘)+1, 17),’:’,”),16,10);
Results In: 1250999896491
Leave a comment
Category: SQL DB
- Add this post to
- Del.icio.us -
- Digg -
- -
- Tweet -
-
-
No comments yet.
You must be logged in to post a comment.