Vishwajeet Jha
What is Difference between "Select 1" and "Print(1)" ?
By Vishwajeet Jha in SQL Server on Jul 27 2015
  • Jaydip Jadhav
    Nov, 2015 2

    Basic difference is that SELECT is Command and PRINT is function

    • 2
  • Munesh Sharma
    Aug, 2015 1

    The parameter to the COUNT function is an expression that is to be evaluated for each row. The COUNT function returns the number of rows for which the expression evaluates to a non-null value. ( * is a special expression that is not evaluated, it simply returns the number of rows.)There are two additional modifiers for the expression: ALL and DISTINCT. These determine whether duplicates are discarded. Since ALL is the default, your example is the same as count(ALL 1), which means that duplicates are retained.Since the expression "1" evaluates to non-null for every row, and since you are not removing duplicates, COUNT(1) should always return the same number as COUNT(*)

    • 2
  • Joe Wilson
    Dec, 2015 23

    Select return the value but print function only display.

    • 1
  • Atul Rawat
    Oct, 2015 20

    select return the value but print function only display

    • 1
  • Yogesh Gandhi
    Aug, 2015 29

    1)Select is command as it is part of SQL whereas Print is not part of SQL, it is used for debugging. 2)Select return datatype supplied whereas Print return varchar.But to layman it will give same output of 1

    • 1
  • Vishwajeet Jha
    Jul, 2015 27

    Both will give same output i.e 1but the important difference is that "Select" statement gives output in Result window and Print() will give output in Message window.

    • 1
  • DHILEEP KUMAR
    Jun, 2018 1

    PRINT 1 will display 1 in message window. select 1 will display 1 in Result window

    • 0
  • sushil kumar
    Jan, 2016 21

    Select is a command which return as tabular form while print is a function which give result in message format. Print return values only in varchar format.

    • 0
  • Ajay Gandhi
    Nov, 2015 20

    Select is Used to get result in result window . Print is Used to print any thing for debugging.

    • 0
  • Sreekanth Reddy
    Nov, 2015 2

    "select" returns the output as table format. "Print" returns the output as text(not in table format)

    • 0
  • naveen sharma
    Oct, 2015 27

    1.select is a command and always return output in raw and column while print is a function in SQL and it return a message in varchar format only. 2. select 1 return output in one raw and one column format while print(1) showing 1 in a message not in result window.

    • 0
  • Sujeet Suman
    Sep, 2015 2

    Select : - Used to get result in result window. Print : - Used to print any thing as a checkpoint in output window.

    • 0
  • Pankaj  Kumar Choudhary
    Aug, 2015 26

    select 1 considered as a table that contain single row and single column , so when you execute this command you will find a message that " (1 row(s) affected)" But print('1') is used to print a text in Sql server 's screen

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS