# Adding duplicated fields in Query Builder

**URL:** <https://forums.toadworld.com/t/adding-duplicated-fields-in-query-builder/6167>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [March 17, 2010, 9:44am UTC](https://forums.toadworld.com/t/adding-duplicated-fields-in-query-builder/6167 "2010-03-17T09:44:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr2001](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@mr2001](https://forums.toadworld.com/u/mr2001)\
**Post date:** [March 17, 2010, 9:44am UTC](https://forums.toadworld.com/t/adding-duplicated-fields-in-query-builder/6167/1 "2010-03-17T09:44:19Z")

</div>

Hello,

I am trying to build a query in Query Builder, like:  
select account, count(account) from General\_Ledger group by account

The problem is that I cannot add the _account field twice_ and apply the aggregate function ‘count’ to the second account field.  
Query Builder apparently allows only one instance of a field. Is this right?  
Of course, I can type the query but some people may want to create it visually, by drag and drop the account field twice, as in MS Access that does not have this limitation.

Is there any way to achieve this functionality?

Regards,  
M.R. Message was edited by: mr2001

Message was edited by: mr2001

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [March 17, 2010, 1:04pm UTC](https://forums.toadworld.com/t/adding-duplicated-fields-in-query-builder/6167/2 "2010-03-17T13:04:49Z")

</div>

You can achieve this by using a Calculated field. See screenshot. Press the tool button for the calcualted field editor. Provide a name for the column and press the +. Enter your count(account) and attach to a table. This will give you what you need.

debbie

 ![CalcField.png](https://global.discourse-cdn.com/quest/original/2X/3/35892bbc9e7fa1bf9ddcefd852ccedb52baa4ab2.png)

---

<div class="post-metadata">

**Author:** ![mr2001](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@mr2001](https://forums.toadworld.com/u/mr2001)\
**Post date:** [March 17, 2010, 1:44pm UTC](https://forums.toadworld.com/t/adding-duplicated-fields-in-query-builder/6167/3 "2010-03-17T13:44:06Z")

</div>

Thanks Debbie, I see what you mean.  
It’s however much more complicated than creating this kind of query in Access. The easiest thing would be to allow field duplication…

Regards,  
M. R.

Message was edited by: mr2001
