ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
What is the difference between two queries:
1. SELECT * FROM table WHERE 1=1;
2. SELECT * FROM table
 Question Submitted By :: Vinod
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 1
First query,in table where 1=1 condition is satisfied that 
row or column is displayed
But in second query,the whole table is displayed
 
Is This Answer Correct ?    2 Yes 4 No
Kohulavani.g
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 2
No Diffrence at all
 
Is This Answer Correct ?    1 Yes 2 No
Rajiv Rohilla
 
 
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 3
Both the Queries will return the same ouput.
That means it will return all the rows that are available 
in the table.
 
Is This Answer Correct ?    2 Yes 1 No
Malathi
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 4
in first query 1=1 always true,then it retrives all columns 
in a table.
so,there is no difference in between these two
 
Is This Answer Correct ?    1 Yes 2 No
G.nageswara Rao
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 5
I am learning SQL Basics..So If my Answer is wrong Plz do
reply to tht,
In the First Query Where 1=1 implies Show all where The
first coloum element is equal to 1

and second query show all from table
 
Is This Answer Correct ?    1 Yes 1 No
Kranthi Kiran
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 6
There is No Difference between these two
 
Is This Answer Correct ?    1 Yes 1 No
Vijay
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 7
Both are returns the SAME results.

I dont know the meaning of the 
SELECT * FROM Table_Name WHERE 1=1
SELECT * FROM Table_Name WHERE 2=2
SELECT * FROM Table_Name WHERE 5=5
SELECT * FROM Table_Name WHERE 100=100
.
.
.
etc..,

It accepts the where both are equal.

If you give like 

SELECT * FROM Table_Name WHERE 100=1001
It is not accept.
 
Is This Answer Correct ?    4 Yes 0 No
Skumar
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 8
hey! I too agree there wont be any difference in result it 
displays but the performance will be different. While 
executing the first query the where condition to be checked 
for each record it displays hence it takes much time to 
execute while compared with question no 2 i.e, without 
where condition. this is what I believe in.
 
Is This Answer Correct ?    1 Yes 1 No
Pavan
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 9
Of course, both the Queries will get you the same data but,

When compared to the first case processing time will be 
slightly reduced in the second case.

Bytes sent from client and Bytes received from server will 
be more in the first case.

and one more thing is better not using "select * from ..."
 
Is This Answer Correct ?    1 Yes 0 No
Krishna Sandeep
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 10
Both are same .
They r showing all results.
 
Is This Answer Correct ?    0 Yes 1 No
Hasan
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 11
The first query satisfies the condition true condition.

both are similar but not same. performance based querys ...
 
Is This Answer Correct ?    2 Yes 0 No
Akbar Ali
 
  Re: What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
Answer
# 12
No difference
 
Is This Answer Correct ?    0 Yes 0 No
Naren
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is data integrity? Explain constraints?  1
Can we use Truncate command on a table which is referenced by FOREIGN KEY?  1
What is referential integrity and how is it achieved? Adea-Solutions1
What is The Use Of TIMESTAMP DataType in SQL Server 2005?  2
How to determine the service pack currently installed on SQL Server? HCL2
How do you measure the performance of a stored procedure? Infosys1
What are the types of backup and tell me the difference between full and differential backup? TCS3
What is INTVAL( )and where we use Plz any body help me  1
Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?  1
Can you explain the types of Joins that we can have with Sql Server?  2
CLR Integration ? what is Notification services ? Satyam1
how to know Who Is Blocking Your SQL Server?  2
What is a trigger?  6
i have 4 tables.. T1, T2, T3, T4.. these tables have the same structure and they store the information entered in different years.. T1 stored 2002, T2 stored 2003, T3 stored 2004 and T4 stored 2005.. i want to copy contents in T1 to T2, T2 to T3, T3 to T4 and T4 to T1.. how do i do that? Temp tables cannot be used..  1
what are the joins,primary key,foriegn key, candidate key, super key and expain them?  2
Explain Active/Active and Active/Passive cluster configurations  1
When do you use SQL Profiler?  2
What is the difference between a stored procedure and a user defined function in sql server? Millennium2
how to select a field with firstletter as capital and remaining are small letters  7
1.Describe way(s) to tune the SQL table in order to optimize performance. 2. Explain SQL Injection and how can you prevent them? Techno-Solutions1
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com