locked
Select in Linq RRS feed

  • Question

  • Why SELECT is at the end in LINQ queries whereas its at the begining in SQL queries?

    markand

    Friday, November 15, 2013 3:12 PM

Answers

  • That is just how it is designed. In SQL, select is actually one of the last things to get evaluated despite being the first thing we write.

    http://blog.sqlauthority.com/2009/04/06/sql-server-logical-query-processing-phases-order-of-statement-execution/


    Bob - www.crowcoder.com

    Friday, November 15, 2013 3:26 PM
  • Hi,

    this is by language designers. If they had decided to put it at start they may have done it.

    For a developer like us, we have to follow what they have set as language semantics.

    If still you are not satisfied, then why you were satisfied with the way variables are declared in C# & PL/SQL? Have you seen how variables are declared in C# & PL/SQL? Are not they different? 

    If that does'nt creates any quesion in your mind, I think in LINQ also it should be simple.

    I hope this may help you.


    One good question is equivalent to ten best answers.

    Saturday, November 16, 2013 5:52 AM

All replies

  • That is just how it is designed. In SQL, select is actually one of the last things to get evaluated despite being the first thing we write.

    http://blog.sqlauthority.com/2009/04/06/sql-server-logical-query-processing-phases-order-of-statement-execution/


    Bob - www.crowcoder.com

    Friday, November 15, 2013 3:26 PM
  • Hi,

    this is by language designers. If they had decided to put it at start they may have done it.

    For a developer like us, we have to follow what they have set as language semantics.

    If still you are not satisfied, then why you were satisfied with the way variables are declared in C# & PL/SQL? Have you seen how variables are declared in C# & PL/SQL? Are not they different? 

    If that does'nt creates any quesion in your mind, I think in LINQ also it should be simple.

    I hope this may help you.


    One good question is equivalent to ten best answers.

    Saturday, November 16, 2013 5:52 AM