how the query giving the result set

  • deba_20032004

    Default port

    Points: 1476

    Dear Sir,

    I never use '>' operator in case of text field with where cluse now i see one example which is written below..

    SELECT CompanyName FROM customers

    WHERE CompanyName > 'a'

    result set

    ----------

    Alfreds

    Berglunds

    Centro comercial Moctezuma

    Ernst Handel

    FISSA Fabrica Inter

    Galería del gastrónomo Eduardo Saavedra

    Island Trading Helen Bennett

    Königlich Essen Philip Cramer

    Laughing Bacchus Wine Cellars Yoshi Tannamuri

    Magazzini Alimentari Riuniti Giovanni Rovelli

    North/South Simon Crowther

    Paris spécialités Marie Bertrand

    Rattlesnake Canyon Grocery Paula Wilson

    Simons bistro Jytte Petersen

    The Big Cheese Liz Nixon

    Vaffeljernet Palle Ibsen

    Wolski Zajazd Zbyszek Piestrzeniewicz

    how it works plz. tell me.

  • rhythmk

    SSCertifiable

    Points: 7162

    deba_20032004 (7/9/2012)


    Dear Sir,

    I never use '>' operator in case of text field with where cluse now i see one example which is written below..

    SELECT CompanyName FROM customers

    WHERE CompanyName > 'a'

    result set

    ----------

    Alfreds

    Berglunds

    Centro comercial Moctezuma

    Ernst Handel

    FISSA Fabrica Inter

    Galería del gastrónomo Eduardo Saavedra

    Island Trading Helen Bennett

    Königlich Essen Philip Cramer

    Laughing Bacchus Wine Cellars Yoshi Tannamuri

    Magazzini Alimentari Riuniti Giovanni Rovelli

    North/South Simon Crowther

    Paris spécialités Marie Bertrand

    Rattlesnake Canyon Grocery Paula Wilson

    Simons bistro Jytte Petersen

    The Big Cheese Liz Nixon

    Vaffeljernet Palle Ibsen

    Wolski Zajazd Zbyszek Piestrzeniewicz

    how it works plz. tell me.

    Have a look on below article.

    http://msdn.microsoft.com/en-us/library/ms141038(v=sql.90).aspx">

    http://msdn.microsoft.com/en-us/library/ms141038(v=sql.90).aspx

    --rhythmk
    ------------------------------------------------------------------
    To post your question use below link

    https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
    🙂

  • Grant Fritchey

    SSC Guru

    Points: 395844

    It's basically using 'a' as it's starting point and bringing back anything that is greater than 'a'. That includes anything starting with 'a' but adding extra letters, so 'aa', 'aaa', etc. That's why you see Alfred. Then, of course, any letters greater than 'a' such as 'b', 'm', 'z'.

    ----------------------------------------------------
    The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
    Theodore Roosevelt

    The Scary DBA
    Author of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd Edition
    Product Evangelist for Red Gate Software

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply