Hi there,
I am a novice SQL Server Programmer. I have got a task to select multiple fields from multiple tables...I have successfully used joins to get the result. but I have got 2 questions
1. Is there any way of combining (concatenating) three strings as one in the query using "AS"
2. The final result had to be GROUPED by one particular field I am using in select statement...But, for every field in select statement, it lets me run the query without error, only if the field is included Group By clause.
Is there any way to avoid it?
yes, you can concatenate multiple strings into a single field with as...
select (f1+ f2 + f3) as singleString
and you to include any fields in the query in the group by clause...just put the field you are concerned with first. -- jp
|||hi jp
Thanks for your reply...
your first answer fetched me correct results but regarding the Group By, I still have the problem :(
|||when you use group by you have to include all the fields from the query statement in the group by clause...|||
thank you jp..............