[SQL] right join problem

2009-10-01 Thread Greenhorn
Hi, I'm trying to retrieve all meter_id from table meter, and for meter_id without amount, I'd like it to show nothing, 'null'. I've used right join here but it's not giving me my desired result. Is there another way to do this? Here's the query I'm trying. Thanks in advance! select m.meter_i

Re: [SQL] Table to Excel

2009-03-27 Thread Greenhorn
2009/3/26 Nicholas I : > Hi , > >  Does any one how to convert table to excel. > >  I just tried the COPY table_name to '/home/user/output.xls' using > delimiters ','; > > but the out put of the table that is the column in a table are tab separted, > all were merged in a single cell. > > -Nicholas

[SQL] bash & postgres

2009-03-22 Thread Greenhorn
Hi, I'm trying to pass variables on a bash script embedded with psql commands. cat header.txt "to1","from1","subject1" "to2","from2","subject2" "to3","from3","subject3" "to4","from4","subject4" cat b.sh #!/bin/bash two="2" psql -h localhost -U postgres -d mobile -c "create temp table header (

[SQL] Oracle to PostgreSQL

2009-03-15 Thread Greenhorn
Hi, I have almost 1300 files from Oracle (no access to oracle server). I have to create the tables and data as follows. -- start script -- file name: aa_asset_type.sql CREATE TABLE AS_ASSET_TYPE ( MAIN_TYPE CHAR(3) NOT NULL, SUB_TYPE NUMBER(3)