Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2005, 12:18 PM
TC TC is offline
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Joining name/value data to flat data

Hi,

I have 2 tables, tblAccount and tblAttribute. tblAccount is a 1 row per user affair, whereas tblAttribute is a name/value table. What I need to do is to combine all the data into a 1 row per user query. Something like:

SELECT tblAccount .*,
tblAttribute.Value AS EmploymentOccupation WHERE tblAttribute.Name='EmploymentOccupation',
tblAttribute.Value AS EmploymentStatus WHERE tblAttribute.Name='EmploymentStatus'
FROM tblAccount
INNER JOIN tblAttribute ON tblAccount.ID = tblAttribute.ID

I know this isn't the way to do this, but any pointers gratefully received.

TIA,
TC

Reply With Quote
  #2 (permalink)  
Old May 19th, 2005, 12:25 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there.. maybe you can post an example.. that will be better to understand what are you trying to achieve...

HTH

Gonzalo
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to export Data from MySql to flat file. SkyMouse XML 2 August 19th, 2008 03:04 PM
Export Mysql data to Flat file using .Net 2.0 SkyMouse .NET Framework 2.0 0 August 18th, 2008 11:36 PM
Joining data from multiple data sources ClaesR BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 0 August 28th, 2006 09:30 AM
How to make hierarchical data "lay flat" using SQL tinlong SQL Language 1 August 1st, 2003 01:38 AM



All times are GMT -4. The time now is 03:01 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.