# Select one of two fields AS that field

**URL:** <https://forum.kirupa.com/t/select-one-of-two-fields-as-that-field/269649>\
**Category:** programming\
**Created:** [August 30, 2008, 2:05am UTC](https://forum.kirupa.com/t/select-one-of-two-fields-as-that-field/269649 "2008-08-30T02:05:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Icy\_Penguin](https://avatars.discourse-cdn.com/v4/letter/i/f6c823/32.png) [@Icy\_Penguin](https://forum.kirupa.com/u/Icy_Penguin)\
**Post date:** [August 30, 2008, 2:05am UTC](https://forum.kirupa.com/t/select-one-of-two-fields-as-that-field/269649/1 "2008-08-30T02:05:25Z")

</div>

Looking for the correct way/syntax to select either “isbn-10” or “isbn-13”, depending on which one exists, with preference given to isbn-13 - AS the field name “isbn”.

So, something like this:

SELECT \*, isbn-10 OR isbn-13 AS isbn FROM books;

(if both fields are filled (i.e., the row has an isbn-10 entry and an isbn-13 entry), I’d like the isbn-13 field to take precedence - meaning it would be selected instead of isbn-10.

:}
