i have a table tbltrans

transno | agent name | date |

--------+-----------+-------

1 01 | waw |2014-10-10|

1 02 | waw |2014-10-15|

1 03 | waw |2014-10-20|

1 04 | waw |2014-10-30|

i want a query for postgresql that calculate the average time for agentname

the result is like this:

agent name | average time|

--------+------------

waw | 5days |

How about this post? Should be very similar...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.