Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 comparison of two column in a table
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

59 Posts

Posted - 12/06/2012 :  09:02:58  Show Profile  Reply with Quote
is it possible for 2 columns in database to be compared directly??
need your comments on these matter
please be good to me im just a newbie thanks in advance!

SELECT ProductID, Barcode, Category, ProductName, Unit, Quantity, AmountPerUnit, UnitCeiling, UnitFlooring
FROM Table_Product
WHERE (ProductName LIKE '%' + @SEARCH + '%') AND (Quantity <= UnitFlooring)

Edited by - Yonkouturko on 12/06/2012 09:04:41

Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/06/2012 :  09:21:13  Show Profile  Reply with Quote
If you are referring to the AND (Quantity <= UnitFlooring), assuming that they are compatible data types in the same table, you CAN do that.
Go to Top of Page

Yak Posting Veteran

59 Posts

Posted - 12/06/2012 :  09:23:55  Show Profile  Reply with Quote


my post is not clear though... yes im referring to that line of code... tnx for the reply ..!!!
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.82 seconds. Powered By: Snitz Forums 2000