View Full Version : combine info from same table


PARSO
10-12-2006, 05:18 AM
Hi

i have a table which contains:
Forename
Surname
Username

I would like to take forename and surname and but the results into a third column called Username.

so in the surname field it would be somthing like: Joe.Bloggs (as the username)

how to i go about doing this?

Thanks in advance

pdx_man
10-12-2006, 03:08 PM
If Username is to be a calculated field, then do not store it. Just alias to calculation in a VIEW, then reference it where you would your table.

Create View YourView AS

SELECT
Forname,
Surname,
Forname + '.' + Surname AS Username
FROM YourTable

But, if you absolutely want to:

UPDATE YourTable
SET Username = Forname + '.' + Surname