Answer the question
In order to leave comments, you need to log in
How to group by field in SQL query?
Good day everyone! Interested in the following question.
There is a sql query in firebird:
select B.ACCOUNTID as A1, B.FIO as A2, B.ACCOUNTGTS as A3, A.NUMBERA as A4, C.MAXCONNECTIONS as A5
from TBGTS B
left outer join TBPHONES A on (A.ACCOUNTID = B.ACCOUNTID)
left outer join TBACCOUNTS C on (A.ACCOUNTID = C.ACCOUNTID)
left outer join TBACCOUNTSUPDATE D on (D.ACCOUNTID = A.ACCOUNTID and D.EMITTERKCID = B.EMITTERKCID)
group by ....
Answer the question
In order to leave comments, you need to log in
GROUP_CONCAT()
select
B.ACCOUNTID as A1,
B.FIO as A2,
B.ACCOUNTGTS as A3,
GROUP_CONCAT(A.NUMBERA SEPARATOR ', ') as A4,
C.MAXCONNECTIONS as A5
from TBGTS B
left outer join TBPHONES A on (A.ACCOUNTID = B.ACCOUNTID)
left outer join TBACCOUNTS C on (A.ACCOUNTID = C.ACCOUNTID)
left outer join TBACCOUNTSUPDATE D on (D.ACCOUNTID = A.ACCOUNTID and D.EMITTERKCID = B.EMITTERKCID)
group by B.ACCOUNTID, B.FIO, B.ACCOUNTGTS, C.MAXCONNECTIONS
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question