3 fields together as one definition.

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

3 fields together as one definition.

Post by anjanesh »

MySQL:
I have a table students with some number of fields. 3 of them are firstname, middlename, lastname. roll is another field.
I want to define name such that
select name from students where roll='123';
should give the same result as
select firstname,middlename,lastname from students where roll='123';
Thanks
User avatar
aquila125
Forum Commoner
Posts: 96
Joined: Tue Dec 09, 2003 10:39 am
Location: Belgium

Post by aquila125 »

CONCAT is your friend!
Post Reply