This worked for me
$post_meta_sql = "select * from $wpdb->postmeta where post_id = {$post_id} and meta_key not like '\_%' and meta_value like '%[shortcode%]'";
This works for shortcodes that do not have any attributes. i.e, [the_shortcode]
But when it has an attribute i.e, [the_shortcode attr1=”aaa”] it will not work. Do you have any suggestions for that? Thanks!