Get last element from wpdb as a string

Okay, I figured it out:

global $wpdb;
 $par_order = $reservation->transaction_id;
$store = wp_get_current_user();
$store_id = $store->ID;
    $sql = "SELECT ID FROM $wpdb->posts WHERE post_type="shop_order" AND post_parent = $par_order AND post_author = $store_id";
$sub_orders = $wpdb->get_var($wpdb->prepare($sql,$seller_id));

thank you @czerspalace for the clue