Do I need a pivot Query?
-
this is my original query: INVOICE NC_DOC NC_VALUE ND_DOC ND_VALUE RC_DOC RC_VALUE 40842 137 130130 140 60000 3 130130 40842 137 130130 141 85060 3 130130 40842 138 -130130 140 60000 3 130130 40842 138 -130130 141 85060 3 130130 40842 139 190130 140 60000 3 130130 BUT Now i need some query like this doctype numberDoc doc_value NC_DOC 137 130130 NC_DOC 138 -130130 NC_DOC 139 190130 ND_DOC 140 60000 ND_DOC 141 85060 RC_DOC 3 130130
-
this is my original query: INVOICE NC_DOC NC_VALUE ND_DOC ND_VALUE RC_DOC RC_VALUE 40842 137 130130 140 60000 3 130130 40842 137 130130 141 85060 3 130130 40842 138 -130130 140 60000 3 130130 40842 138 -130130 141 85060 3 130130 40842 139 190130 140 60000 3 130130 BUT Now i need some query like this doctype numberDoc doc_value NC_DOC 137 130130 NC_DOC 138 -130130 NC_DOC 139 190130 ND_DOC 140 60000 ND_DOC 141 85060 RC_DOC 3 130130
It looks like you have simply added the doctype column!
Never underestimate the power of human stupidity RAH
-
It looks like you have simply added the doctype column!
Never underestimate the power of human stupidity RAH
yes!! using this 3 columns nc_doc nd_doc and rc_doc , and then transpose as DocType... any ideas!!!?
-
this is my original query: INVOICE NC_DOC NC_VALUE ND_DOC ND_VALUE RC_DOC RC_VALUE 40842 137 130130 140 60000 3 130130 40842 137 130130 141 85060 3 130130 40842 138 -130130 140 60000 3 130130 40842 138 -130130 141 85060 3 130130 40842 139 190130 140 60000 3 130130 BUT Now i need some query like this doctype numberDoc doc_value NC_DOC 137 130130 NC_DOC 138 -130130 NC_DOC 139 190130 ND_DOC 140 60000 ND_DOC 141 85060 RC_DOC 3 130130
It looks more like unpivot to me.
People say nothing is impossible, but I do nothing every day.