TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
prabhu p
NA
181
113.9k
How to change order of variable that contains array of dat
Feb 5 2016 10:54 AM
Iam writing stored procedure in that iam using pivot for columns and assign columns to variable
@sqlquery1 = jan2015,feb2015,march2015
@sqlquery2 = jan-Transferdate,feb-transferdate,mar-transferdate
Iam calling this two variable in select statement like '+@sqlquery1+','+@sqlquery2+' but out came like
jan2015,feb2015,march2015,jan-Transferdate,feb-transferdate,mar-transferdate
but i need out put like
jan2015,jan-Transferdate,feb2015,feb-transferdate,,march2015,mar-transferdate
Reply
Answers (
1
)
Union and Joins
Join 3 tables and fetch for latest record from 3rd table