how the query giving the result set

  • 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.

  • 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
    🙂

  • 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

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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