October 28th, 2012, 05:20 PM
How to name a column from data stored in certain row?
Hello, thank you for reading this and trying to help me, I am trying to name a column from data stored in a row (Phone number) I want to name it from the first 3 digits (Area code) and I have no clue how to do it I have googled but I think the query is a little too complicated for me to explain it and get a result from google or find it in a section of a book.
My phone numbers are strings, so I initially look for the first 3 characters and then start separating and counting, I can do that, the only problem I have is naming the column WITH the the first three digits that I just separated.
All help would be greatly appreciated, thanks in advance.
October 28th, 2012, 05:38 PM
Post an example of your database structure. It sounds to me like you're going to need to restructure it, but it's a little hard to understand based on your description.
October 28th, 2012, 06:12 PM
in addition, please mention whether you are using mysql or oracle
one of your cross-posts will then be deleted
October 28th, 2012, 08:10 PM
I am using oracle but I heard that they are quite similar and I thought that maybe in one of the two forums I would get some direction. I will continue explaining the problem in my oracle post and will delete this one I apologize for the inconvenience.
Originally Posted by r937
October 29th, 2012, 02:08 AM
Whoever told you that was wrong.
Originally Posted by miguelosaurio
There are tons of SQL features that MySQL is lacking. And there are some (albeit a lot fewer) features that MySQL has that Oracle doesn't.
I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
Tips on how to ask better questions: