Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE VIEW profiles AS
- SELECT
- row_number() OVER (ORDER BY a.groupname) AS id,
- a.identity,
- a.users,
- a.groupname,
- b.value AS shared,
- c.value AS period,
- d.value AS rate,
- k.value AS portlimit,
- formatbytes(e.value) AS quota,
- formatbytes(f.value) AS valume,
- g.value AS times,
- h.value AS daily,
- i.value AS ppp,
- j.price,
- j.discount,
- a.description
- FROM radgroupcheck a
- LEFT JOIN radgroupcheck b ON a.groupname = b.groupname AND b.attribute = 'Simultaneous-Use'
- LEFT JOIN radgroupcheck c ON a.groupname = c.groupname AND c.attribute = 'Access-Period'
- LEFT JOIN radgroupreply k ON a.groupname = k.groupname AND k.attribute = 'Port-Limit'
- LEFT JOIN radgroupreply d ON a.groupname = d.groupname AND d.attribute = 'Mikrotik-Rate-Limit'
- LEFT JOIN radgroupreply e ON a.groupname = e.groupname AND e.attribute = 'Mikrotik-Total-Limit'
- LEFT JOIN radgroupcheck f ON a.groupname = f.groupname AND f.attribute = 'Max-Data'
- LEFT JOIN radgroupcheck g ON a.groupname = g.groupname AND g.attribute = 'Max-All-Session'
- LEFT JOIN radgroupcheck h ON a.groupname = h.groupname AND h.attribute = 'Max-Daily-Session'
- LEFT JOIN radgroupreply i ON a.groupname = i.groupname AND i.attribute = 'Framed-Protocol'
- LEFT JOIN radprice j ON a.groupname = j.groupname
- GROUP BY a.identity, a.users, a.groupname, b.value, c.value, d.value, k.value, e.value, f.value, g.value, h.value, i.value, j.price, j.discount, a.description;
Add Comment
Please, Sign In to add comment