Thanks for that, i corrected myself above. it was a mistake a made while posting. sorry about that i have to remember to double check before posting... I still have the issue described above though. any help would be greatly appreciated.
when i execute this code, i get
id s98 s99 s00 yr_joined
============================================
1 206 65 11 2000
2 0 23 11 2000
3 0 0 11 2000
4 99 23 11 2000
5 614 0 11 2000
for the result set... when it should be (or i should say I want it to be)
id s98 s99...
ignore the 'Green' i typed that accidentally same thi g with the line below... what i actually had was:
Create Table #T1 (Id Int, s98 Int,s99 Int, s00 Int, yr_joined varchar(4))
Insert Into #T1 Values(1, 206,65,11,'')
Insert Into #T1 Values(2, 0,23,11,'')
Insert Into #T1 Values(3, 0,0,11,'')...
I'm trying to rebuild and reorganize a database table. This table i'm working off of has a column for every year going back to 1973 and the total number of goods purchased by a customer in each column (it's very unorganized). There isn't a customer file and I'm trying to create one with a...
I didn't think of that at all. That definitely simplifies things. Thanks Denis. The data currently isn't in 1s and 0s it's actually in letters, but i'm going to convert it for this and change it back afterwards.
Out of curiosity, is there some other way this could work without summing and...
just a suggestions, you may have to cast/convert the count as a float if you want the percentage. I've had some problems converting counts to percentages with that in the past.
cast(count(inv_skids) as float)/(select cast(count(inv_skids)) as float) from table1)
Thanks for the quick reply Dennis. The columns i'm referring to are columns that represent different flags in a record, so 0 or 1 will work (even though i was jsut using it as an example).
With the query you wrote above, it would also return records where (lets say i am looking for cases where...
I am trying to create a query where 50% or more of the options in my where clause are true. For example lets say i have 4 cols for a record that relate to some kind of code.
call them Col1, Col2, col3, col4. Instead of writing out all the different permutations of ways 75% or more of the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.