Hi there, i want to run a query against an ingres database and output the results to file.
I can do this for other queries, i have a problem that my query is joining 2 tables and they both contain the same field that i am requesting.
I only want data ffrom that field from one of the tables.
Here is my query
Code:
DECLARE GLOBAL TEMPORARY TABLE SESSION.temp_session_table
AS
SELECT map_uid map_name, map_sex
FROM map, linkage_maps
WHERE map.map_uid = linkage_maps.map_uid
ON COMMIT PRESERVE ROWS
WITH NORECOVERY
\g
COPY SESSION.temp_session_table (
map_uid = char(0)tab with null ('bOngO'),
map_name = char(0)tab with null ('bOngO'),
map_sex = char(0)tab with null ('bOngO'),
)
INTO 'mapping_data.txt'
\g
i want to select all map_uids and map_name from map and map_sex from linkage_maps where the map_uids between the 2 tables match up.
i get an error saying E_US0835 line 1, Column 'map_uid' found in more than one FROM list table.
if i try saying select map.map_uid .....
then the first bit executes but fails on the
E_US09CA line 1, Syntax error on ')'. The correct syntax is:
COPY TABLE tablename (columnname = format [null_clause] {, ... })
INTO|FROM 'filename'
[with_clause]
i know the syntax is ok for the declare and copy table part as i have used another query without this field in two tables problem and it creates the temporary table no problem.
Any ideas anyone?