Click here to Skip to main content
13,048,846 members (76,672 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
how can i get mutiple column values from multiple sql views?
Posted 12-Sep-12 20:14pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Learn JOINS in SQL and use it:
http://www.w3schools.com/sql/sql_join.asp[^]
  Permalink  
Comments
Rnkz 13-Sep-12 2:25am
   
that cannot be done by JOIN, because there is only one table for this.

Coulumns are userName, processDate, processID

I need to get each user's total proccesses for each day. So the user names cannot be in rows, it has to be in columns
Rnkz 13-Sep-12 2:26am
   
Actually i need the out put as below,

date userA userB userC

01/09 10 12 3
02/09 12 3 5
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hi,

try like this,
SELECT V1.col1, V2.col2, V3.col3 FROM View1 V1 
INNER JOIN View2 V2 ON V1.Col1 = V2.Col1 
INNER JOIN View3 V3 ON V1.Col2 = V3.col3


hope it works.
  Permalink  
Comments
Rnkz 13-Sep-12 2:31am
   
Coulumns are userName, processDate, processID


Coulumns are,

userName processDate processID

userA 09/01 0001
userA 09/01 0002
userB 09/01 0003
I need to get each user's total proccesses for each day. So the user names cannot be in rows, it has to be in columns

Actually i need the out put as below,

date userA userB userC

01/09 10 12 3
02/09 12 3 5
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

that was quite easy, i just created some views & joined them!
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 14 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100