|
| |
|
|
pd_it_guy
Posts: 191 Joined: 3/4/2008 Status: offline
|
How do I do this? - 7/29/2008 13:47:48
Part of an SQL (Informix) for linked tables. Unfortunately, I need both sets of x-coordinates and y-coordinates (from tables g and s) so I need to rename the column headings so my DB calcs work right. This is always refreshing and provides the column headings that are permanently embedded in the table. SELECT ... g.x_coordinate, g.y_coordinate, ..., ... s.x_coordinate, s.y_coordinate... FROM informix.go_data g, informix.sv_data s ... Can we alias the column heading somehow? Thanks for any and all ideas!
|
|
|
|
BeTheBall
Posts: 6381 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: How do I do this? - 7/30/2008 13:25:56
Generally you just use an AS statement to alias a heading. Something like: SELECT ... g.x_coordinate AS blah, g.y_coordinate AS blahblah, ..., ... s.x_coordinate, s.y_coordinate... FROM informix.go_data g, informix.sv_data s ... [/quote] See if that works for you.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
pd_it_guy
Posts: 191 Joined: 3/4/2008 Status: offline
|
RE: How do I do this? - 7/30/2008 15:00:58
Thanks for responding. We tried it that way, and even put it in brackets, went to syntax error. The only thing thta we can do is concat a character thus: ..., 'svs'||g.x_coordinate, ... which does in fact change the column name returned to svs||x_coordinate, but also all the data that follows has the appendage. The web unanimously says the way you describe has to work, but for reasons as yet unknown it does not.
|
|
|
|
ou812
Posts: 1601 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: How do I do this? - 7/30/2008 15:54:21
It has been a long time since I've used Informix so forgive me if I steer you wrong. I'm not sure why "as" isn't working to alias but you could create a temp table (informix does these on the fly, right) with the columns needed and load your query results into the temp table then just do a simple select on the temp table with the headings you need.
_____________________________
-brian EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
|
|
pd_it_guy
Posts: 191 Joined: 3/4/2008 Status: offline
|
RE: How do I do this? - 7/31/2008 12:06:32
Problem is solved. It had nothing to do with Informix, it was all about MSQuery external data. Instead of picking up the table data directly into Excel, I made up a simple FP website, set a data connection to the same table to unload data, (put it on the diet, of course!) and it unloaded, aliased, and displayed just fine. Apparently, the data results connection routine when using FP is much simpler, straightforward, and robust than the external data grab with MSQuery. MSQuery's SQL has a few peculiarities as well. Thanks to all of you for your interest and good ideas
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|