adding two field's data ino one field

moumon
11-01-2004, 12:51 AM
hello

The following SQL command adds two fields data into one field.

tbl1 structure:
_____________________________
field1 field2

a1 b1
a2 b2
a3 b3
a4 b4
____________________________

Select field1,field2 as fieldNew from tbl1;

the result is :

___________________________
fieldNew

a1b1
a2b2
a3b3
a4b4

__________________________


But I want to get:


_________________________

fieldNew

a1
a2
a3
a4
b1
b2
b3
b4


________________________



Please anyone help me to solve this problem.


Thank you all.

Bye...

Dennis DVR
11-01-2004, 03:11 AM
If the datatype of field1 and field2 are both character then a simple union would do the trick.

SELECT Field1 FROM tbl1 UNION SELECT Field2 FROM tbl1

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum