what if you wanna do it the other way around? when you have it with comas and you wanna have it listed one below the other?
@vrreddy1147
2 жыл бұрын
We use string_agg function instead of xml path select deptno,string_agg(job,' , ') as ename from emp group by deptno
@MaDmAxLoCaL
2 жыл бұрын
What is the job represents here?
@MaDmAxLoCaL
2 жыл бұрын
String_agg was not working in sql server 2016
@EldarZeitgeist
3 жыл бұрын
i've used this video to write a query that displays the ReservationID and the added services for each reservation from a table i named (Reservation) it works fine with me but what if i want to display not only these two columns, i want to display also another column from another table along with them f.g add GuestName from guest table and room number from room table noting that i tried to use the JOIN and add it after the query but it's not working with me
@harithaakula2115
3 жыл бұрын
What if Id and country are present in 2 different tables
@dhandrohit
3 жыл бұрын
Use joins for those two tables.
@harithaakula2115
3 жыл бұрын
@@dhandrohit can you give any example
@vrreddy1147
2 жыл бұрын
select *, (select string_agg(ename,' , ') from emp e where e.deptno=d.deptno )as ename from dept d
@RaMeShBaBu-gf1wc
3 жыл бұрын
If you increase zoom then video will become good. Unable to see code
Пікірлер: 10