Re: [SQL] SQL query problem

2003-10-09 Thread Stuart Barbee
Marek,

Not sure but, try switching the lines

  db_data.mda_mod_con _CON, 
  db_data.set_mda_fue _FUE 

with 

  db_data.set_mda_fue _FUE, 
  db_data.mda_mod_con _CON 

so there query is:

SELECT
  _CON.con_id,
  _MOD.mod_ty,
  _VER.version,
  _YEA.year,
  _CON.dri_id,
  _CON.man_cod,
  _ENG.eng_pow
FROM
  db_data.mda_mod _MOD,
  db_data.mda_mak_eng _ENG,
  db_data.set_mda_fue _FUE,
  db_data.mda_mod_con _CON
  LEFT JOIN db_data.mda_mod_ver _VER ON _VER.ver_id =
_CON.ver_id
  LEFT JOIN db_data.mda_mod_yea _YEA ON _YEA.yea_id =
_CON.yea_id
WHERE
  _MOD.mod_id = '283' AND
  _CON.mod_id = _MOD.mod_id AND
  _CON.psd <= NOW() AND
  _CON.ped > NOW() AND
  _ENG.eng_id = _CON.eng_id AND
  _ENG.eng_fue = _FUE.fue_id



--- Marek Lewczuk <[EMAIL PROTECTED]> wrote:
> Hello,
> I'm in the middle of the migration process from
> MySQL to PostgreSQL and
> I cannot understand why this query isn't working (in
> MySQL it's working
> fine). PG returns: ERROR:  Relation "_con" does not
> exist
> 
> This is my query:



__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [SQL] REPOST[GENERAL] Quoting for a Select Into - Please Help

2004-01-14 Thread Stuart Barbee
Alex,

  Postgres's "select into" does not work like oracle. 
The "select into" for postgresql creates another
table.  Try this;

select aliasvalue || trim(arrayval[i]) into
newtablename from currenttablename where 
 trim(searchfield) like '%' ||
 trim(searchvalue) || '%';

Stuart


--- A E <[EMAIL PROTECTED]> wrote:
> Hi,
>  
> Could someone help me with quoting this right?
>  
> select into aliasvalue ''|| trim(arrayval[i]) ||'' 
> from ''|| trim(realname) ||'' where ''||
> trim(searchfield) ||'' like %''||
> trim(searchvalue) ||''%; 
>  
> The parser does not seem to want to put the value of
> the variables into the statement.
>  
> Alex
> 
> 


__
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])