SQL: how to get the left 3 numbers from an int
        Posted  
        
            by dmr
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by dmr
        
        
        
        Published on 2010-04-14T18:36:49Z
        Indexed on 
            2010/04/14
            18:43 UTC
        
        
        Read the original article
        Hit count: 316
        
sql
I want to retrieve the left 3 numbers from an integer to be stored in a table. For example, if the int is 1234567, I want to retrieve 123. I want the second number (123) to also be an int; I don't want to convert anything to a string.
(And yes, really I should be working with strings. But I don't have control over that aspect of the issue.)
Thank you!
© Stack Overflow or respective owner