473,480 Members | 2268 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dividing field contents in Mysql

190 New Member
I have a table in which i have uploaded data full address of individuals including area and city , but now i have realized that i should have separate area and city columns . Is there any way by which i can divide my address in address1 , address 2 and city .

for ex

address1

flat no 1 , block b , ashok nagar , delhi

i want

address1...... address2..... city
flat no1......ashok nagar.....delhi
block b
Apr 22 '08 #1
2 1540
debasisdas
8,127 Recognized Expert Expert
You need to do so manually .
Apr 22 '08 #2
mwasif
802 Recognized Expert Contributor
I have a table in which i have uploaded data full address of individuals including area and city , but now i have realized that i should have separate area and city columns . Is there any way by which i can divide my address in address1 , address 2 and city .

for ex

address1

flat no 1 , block b , ashok nagar , delhi

i want

address1...... address2..... city
flat no1......ashok nagar.....delhi
block b
You can do it with the help of string functions i.e. LOCATE(), SUBSTRING() and SUBSTRING_INDEX() only if your data is in a specific format for all records. e.g.

flat no 1 , block b , ashok nagar , delhi
flat no 1 , block b [address 1]
ashok nagar [address 2]
delhi [city]

House no 19, block f , Mehrauli , delhi
House no 19, block f [address 1]
Mehrauli [address 1]
delhi [city]

In the above examples, address 1 is till 2nd comma
address 2 after 2nd comma and the city is after 3rd comma.
Apr 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1596
by: Krishna Prasad | last post by:
Hello, I am in the process of designing the following kind of system -- A MySQL database holds hundreds of thousands of entries. All of these entries are periodically processed by a set of...
1
3392
by: Don Leverton | last post by:
Hi Folks, I have been given a CD with approx 130 .xls files (bean-counters!) that I would like to import and merge to ONE table (tblTradeshow). The XL files are *similarly*, but not...
3
579
by: John young | last post by:
I have been looking for an answer to a problem and have found this group and hope you can assist . I have been re doing a data base I have made for a car club I am with and have been trying to...
25
10162
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
5
9232
by: Hasanain F. Esmail | last post by:
I have spent many hours to solve this problem but no result yet. Your help will highly be appriciated. Problem: Let us say I have two field named as number1 and number2 There are 12 pcs of an...
6
2770
by: MLH | last post by:
"The following unexpected error occurred in Sub CopyMySQLbttn_Click, line #250, CBF on frmVehicleChooserform. 2465: "Can't find the field 'forms' referred to in your expression. You may have...
6
38208
by: monomaniac21 | last post by:
Hi all Is there a way to insert text into a mysql text field that already has text into it; without having first to extract the existing data and append the new text to that string variable and...
2
6138
by: hph | last post by:
Please be gentle; I am a relative newbie for php/MySQL, and most of what I am doing is based on being self-taught using someone else's well-written code, and my own googling the answers to my...
4
22454
by: Bob | last post by:
Hi all, I've got a table that I've imported and it has junk at the top of the table, so after import I run a delete query to remove the junk lines then I'm left with the field names I want for...
1
1306
by: vadiraj | last post by:
plz help me to display the contents in an table page by page Eg: 10 entries per page
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6756
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4495
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3008
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.