Displaying post excerpt using wpdb query

I guess your post_excerpt field is empty and you need to generate an excerpt from the post_content.

I agree with @t f using the general WP_Query(), have_post(), the_post(), the_excerpt() method of looping.

I just want to mention that WordPress comes with the handy wp_trim_words() function that can be used to shorten text strings.

Outside the loop, one can also make a custom version of wp_trim_excerpt():

function my_trim_excerpt( $text, $length = 55, $more=" […]"  )
{
     $text = strip_shortcodes( $text );
     $text = apply_filters( 'the_content', $text );
     $text = str_replace(']]>', ']]>', $text);

     $excerpt = wp_trim_words( $text, $length, $more );
     return $excerpt;
}

where it can be use it like this:

echo my_trim_excerpt( $mylongtext );

or

echo my_trim_excerpt( $mylongtext, 40, ' […]' );

So if your text is:

Bacon ipsum dolor sit amet drumstick turducken sirloin bacon, jowl
tail sausage ham hock flank shank pork kielbasa beef hamburger
leberkas. Tongue beef ribs ham hamburger fatback chuck pork belly
shoulder biltong sausage tenderloin swine porchetta cow. Kielbasa
kevin leberkas short loin andouille pork. Pork belly pork short ribs
bacon jerky venison, spare ribs brisket sausage flank. Kielbasa salami
ham hock leberkas doner. Sausage beef tenderloin venison doner chuck.
Sausage beef tongue, chuck pig turkey pork landjaeger porchetta pork
belly biltong tri-tip.

then:

echo my_trim_excerpt( $longbacontext, 10, ' [enough bacon]' );

will shorten it to:

Bacon ipsum dolor sit amet drumstick turducken sirloin bacon, jowl [enough bacon]