SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

Yonkouturko
Yak Posting Veteran

Philippines
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

sunitabeck
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

Yonkouturko
Yak Posting Veteran

Philippines
59 Posts

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

ohmygash

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  
 New 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.03 seconds. Powered By: Snitz Forums 2000