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 |
|
best_boy26
Starting Member
42 Posts |
Posted - 2011-03-17 : 14:29:10
|
Hi All,I Have a Excel sheet. which has A column to J total 10 coulmns.And the below formula starts from rownumber 14th in J column and fills the sheet. How would i write this in the SQL?=(J13*(11)+E13)/12 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-03-17 : 14:35:19
|
| The column references (J and E) would be replaced by the column names they represent. The row references (J13 and E13) would be removed. If J was "ShoeSize" and E was "WaistSize" then:SELECT (ShoeSize*11+WaistSize)/12 FROM myTable |
 |
|
|
best_boy26
Starting Member
42 Posts |
Posted - 2011-03-17 : 14:39:19
|
| What about these rows are changing every time... so how best i can include the rowcount concept here ? |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-03-17 : 14:48:28
|
| If J13 and E13 contain other formulas then you'll have to include them in your SELECT expression.What is that formula supposed to calculate? What's the overall data (supposed to) look like? An example would be most helpful.SQL works on all rows in a set, it does not number them by default, so row number is not a valid concept. You can generate them with the ROW_NUMBER() function, but it's not part of the data you're accessing, therefore a formula that relies on row number is not valid. |
 |
|
|
|
|
|