sql - Concatenation issues -


i have table "patient" has 5 fields.

create table patient (pat_id         char (4) primary key,  pat_name       varchar (7),  admitted       date,  room           char (3),  doctor         varchar (7));  insert patient values (1001, 'fred', '30-mar-07', 101, 'payne'); 

i want create view output this:

patient      doctor       room         admitted     "-----------------------------------------------" 1001 fred    payne        101      march 31, 2007 

the problem want concatenate pat_name , pat_id own separate "patient" column have other 3 fields concatenated (notice there no separation in 'dashes').

basically, want 1 single column 5 columns concatenated, need have first 2 columns combined single subcolumn named "patient".

can concatenate within concatenation?

select concat(pat_id, ' ', pat_name) patient,     doctor doctor, room room, admitted admitted patient 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -