Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed - Identical input field value

Status
Not open for further replies.

mseleem2005

Vendor
Aug 14, 2005
1
0
0
GB
Help needed - Identical input field value

Hi
I have a MySQL Database table, I would like to know how could I have one of my fields in my table to have the same inputs of 3 other fields in the same table with a dash "-" between then when submiting a new entry.

The 3 fields type are VARCHAR.

Thanks in advance.
M Seleem.
 
You could use something like:
[tt]
INSERT tbl
SET
f1='abc',
f2='def',
f3='ghi',
f4=CONCAT(f1,'-',f2,'-',f3)
[/tt]
However, you are inserting redundant data, which is usually best avoided.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top