# Pt-find - Can I return --exec select result?

**URL:** <https://forums.percona.com/t/pt-find-can-i-return-exec-select-result/18783>\
**Category:** Percona Toolkit\
**Created:** [November 28, 2022, 2:43am UTC](https://forums.percona.com/t/pt-find-can-i-return-exec-select-result/18783 "2022-11-28T02:43:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Gleba](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/david_gleba/32/8474_2.png) [@David\_Gleba](https://forums.percona.com/u/David_Gleba)\
**Post date:** [November 28, 2022, 2:43am UTC](https://forums.percona.com/t/pt-find-can-i-return-exec-select-result/18783/1 "2022-11-28T02:43:56Z")

</div>

I would like to return the max(id) from a table using pt-find.

```auto
pt-find -h 10.4.1.245 -P 3306 -u admindb -p $admindbpw -D prodrptdb \
     --exec "select max(id) from GFxPRoduction "

```

This is all I see when running it.

```auto
+ pt-find -h 10.4.1.245 -P 3306 -u admindb -p dep768intel -D prodrptdb --exec 'select max(id) from GFxPRoduction '

# A software update is available:

```

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [November 28, 2022, 4:41am UTC](https://forums.percona.com/t/pt-find-can-i-return-exec-select-result/18783/2 "2022-11-28T04:41:06Z")

</div>

pt-find requires you to first “find” something and then you can ‘exec’ on what you found. In your example, you do not have anything to find, thus your exec does nothing. Check out [the documentation](https://docs.percona.com/percona-toolkit/pt-find.html) for more info.

As a side note, why are you using pt-find for this? You can do this by simply using the mysql client:

```
mysql -h 10.4.1.245 -u admindb -p${admindbpw} prodrptdb -e "select max(id) from GFxPRoduction"

```

Using the client like this is far more efficient than using pt-find.
