473,394 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how to divide a column into two

hi
There is two columns in table name and emp...name column contains the names of some people and emp is a flag--'y' or'n'.we are suppossed to divide the name column into two columns emp_name and nomemp_name depending on the value of the flag 'y' and 'n' respectively..
can u plz tell me how it can be done??
Oct 30 '06 #1
2 2722
Hello


Try this
SELECT DECODE(emp,'Y',Name,'') emp_name , DECODE(emp,'Y','',Name) nomemp_name FROM Table;

From your mail I understood that you need to make a query only(Not a table!!!)

If its a table , then CREATE TABLE Newtable AS (select ..)


Regards
Reshmi
Oct 31 '06 #2
Hi

Use Decode Function To divide A column into two column.

hi reshmi ur decode qry Option same Condition. It wil give same result of
two column.

pls Try this condition

SELECT DECODE(emp,'Y',Name) emp_name , DECODE(emp,'N',Name) nomemp_name FROM Table;


With regards,
Captain
Nov 1 '06 #3

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

Similar topics

4
by: Jack Smith | last post by:
Hello, I am working on the following problem. I need a divide and conquer algorithm to solve the following problem. Any help is appreciated. I have a set of coordinates (x,y) and each...
2
by: Mike Leahy | last post by:
All... I have a query that calculates various using variables from a survey database. As with any survey, there are many instantces of null values. I'm wondering if there is any way to escape...
0
by: Gary Carson | last post by:
Can anyone tell why the query below would throw a divide-by-zero error? The only reason I can see for the error happening would be if SUM() came out to be zero, but this never happens with the...
3
by: Joriveek | last post by:
When I specify a formula between Computed Column Specification, I have two zero values, getting Divide by Zero error, any idea how can I avoid this? I still want SQL Server to display Zero if it is...
0
by: mokazawa1 | last post by:
Hi, I need to use Java and Stored Procedures for DB2 UDB to solve the following problem. I have a single table that have many registers with column that indicates the starting time to process....
40
by: Spiros Bousbouras | last post by:
Do you have an example of an implementation where sizeof(short int) does not divide sizeof(int) or sizeof(int) does not divide sizeof(long int) or sizeof(long int) does not divide sizeof(long long...
1
by: Justin.Velazquez | last post by:
Hello everyone, I'm not really new to programming but my bitwise skills definately need work. I came across a problem I've been trying to figure out for fun. I'm trying to write a routine...
1
by: theone2007 | last post by:
Can someone please help me out. if i have a XML tag as follows how can i take the information from the middle and do a choos statement. The tag is a follows: <column item="test" Count="20"> ...
1
by: prasadgopathi | last post by:
hi friends, i have one table is normal column is bit id isnormal 1 0 2 0 3 0 4 1
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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
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...

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.