What is the difference between two queries:
1. SELECT * FROM table WHERE 1=1;
2. SELECT * FROM table

Answer Posted / chinnu

Hi SQL gurus,

i am working for an MNC...

My team is having a problem in sql server. when user slects
date prompts from jan 1st to april 30, it should display
all months data like :

jan aa
feb bb
mar cc

but when it comes to april its taking data like :

jan aa
feb bb
mar cc
apr dd...and so on

means its taking data again from jan to april which we dont
want. we want the data only april month as we are getting
jan, feb and mar...

can any one write the code to relsove the issue please

would be greatful if you can send to shiva_sans@yahoo.co.in

and also please send your email also ...so that we will be
in touch for any kind of queries ...


Thanks a lot in Advance !!!

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to test a dml trigger in ms sql server?

790


How to loop through result set objects using mssql_fetch_array()?

798


How do you handle datasets larger than 50 gb?

154


Is ssrs support other database except ms sql server?

106


What do you understand by user-defined function in the sql server and explain the steps to create and execute a user-defined function in the sql server?

733


What is the exact numeric data type in sql?

778


Name some of the open source software that you can use in alternative to SSR?

136


What are the difference between primary key and unique key? : sql server database administration

747


Why union all is faster than union?

709


What is apply operator in sql?

788


What is a result set object returned by mssql_query()?

794


How can we migrate from SQL server to SQL Azure?

108


Why we use the openxml clause?

765


can we have a nested transaction? : Sql server database administration

734


Give the query of getting last two records from the table in SQL SERVER?

749