Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
musab2012
Starting Member
1 Post |
Posted - 2013-04-02 : 02:45:41
|
Hi brotherspls guys i need some one help me about this Question3.1.1.List all columns of all rows in the STOCKITEM table in ascending primary key sequence. Only list rows where the selling price is greater than the purchase price multiplied by 3 or the selling price is less than the purchase price multiplied by 2 ??i did this stastment but the ruselt not come with multiplied by 2 or 3 ,,SELECT * FROM stockitemwhere sellprice > purchprice *3or sellprice < purchprice *2order by stkid asc; |
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2013-04-02 : 05:26:05
|
Well there might not be any record as per where condition. SELECT SellPrice,PurchasePrice*3 As PuchMultiplyThree, PurchasePrice*2 as PurchMultiplyTwo FROM StockItem; Check if there is any SellPrice value which is "greater than col2" OR "Less than col3" of the above query? If no then the query should not return any record at all.CheersMIK |
|
|
|
|
|