June 12, 2015 at 12:02 am
Hi,
I want to get output of below query in single row.
Select 'Name'
Select 'Surname'
Expected output is Name,Surname
Regards,
Vipin Jha
June 12, 2015 at 12:37 am
vipin_jha123 (6/12/2015)
Hi,I want to get output of below query in single row.
Select 'Name'
Select 'Surname'
Expected output is Name,Surname
Regards,
Vipin Jha
Continuing with your theme of minimal information:
Select Name, Surname
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
June 12, 2015 at 2:16 am
What if out form both statement comes from 2 different table.
Regards,
Vipin jha
June 12, 2015 at 2:24 am
vipin_jha123 (6/12/2015)
What if out form both statement comes from 2 different table.Regards,
Vipin jha
JOIN the tables.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
June 12, 2015 at 4:33 am
Woke up to this..... Phil you made my Phriday!
Steve.
June 12, 2015 at 6:33 am
Phil Parkin (6/12/2015)
vipin_jha123 (6/12/2015)
What if out form both statement comes from 2 different table.Regards,
Vipin jha
JOIN the tables.
Don't need any JOIN 😛
DECLARE @Name varchar(255),@Surname varchar(255);
SELECT @Name = [Name] FROM [table1];
SELECT @Surname = [Surname] FROM [table2];
SELECT @Name AS [Name],@Surname AS [Surname];
:w00t:
NOTE THIS NOT A REAL ANSWER
just joining in along the same vein as Phil 😉
Far away is close at hand in the images of elsewhere.
Anon.
June 12, 2015 at 7:00 am
ahh but David, Surname is in table2 not table1. How would we get the value from table2 instead? :hehe:
Steve.
June 12, 2015 at 7:04 am
stevefromOZ (6/12/2015)
ahh but David, Surname is in table2 not table1. How would we get the value from table2 instead? :hehe:
Deliberate mistake 😛
😀
Far away is close at hand in the images of elsewhere.
Anon.
June 12, 2015 at 12:47 pm
Can we add the address too please...feels somewhat incomplete without it 😀
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply