WP Query get only 1 post (sticky, not sticky etc)

I’m using WP Query & want to only return 1 post in a category.

Either the most recent sticky else the latest post.

Is this possible?

Thanks,
George

<?php
            $category1 = new WP_Query();
            $category1->query( array('showposts' => 1, 'category_name' => 'hapless  ' ));
            while ($category1->have_posts()) : $category1->the_post(); ?>

                    <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
                    <?php the_post_thumbnail(); ?>  

            <?php endwhile; ?>

Solutions Collecting From Web of "WP Query get only 1 post (sticky, not sticky etc)"

Why don’t you use a fat-free $wpdb->get_var() for the task?

global $wpdb;
$ID = $wpdb->get_var("SELECT `ID` FROM {$wpdb->posts}
    WHERE `post_type`='post' AND `post_status`='publish'
    ORDER BY `post_date_gmt` DESC LIMIT 1;");
$post = $ID ? get_post($ID) : null; // Now get the actual post

This is way more efficient and light-weight. Without all the bells and whistles of the get_posts() or WP_Query().

Regards.

UPDATE: (more in context)

function get_last_published_post(){
    global $wpdb;
    // Get the ID of the last published post (by date)
    $ID = $wpdb->get_var("SELECT `ID` FROM {$wpdb->posts}
        WHERE `post_type`='post' AND `post_status`='publish'
        ORDER BY `post_date_gmt` DESC LIMIT 1;");
   return $ID ? get_post($ID) : null; // Now get the actual post
}
// Should print out the Post object
var_dump(get_last_published_post());