Re: [SQL] position(text,text) function

2001-07-23 Thread Dorin Grunberg
The correct way would be: select position('el' in 'Hello'); Dorin At 02:27 PM 7/23/01 +, Karl Orbell wrote: I'm having trouble using the position function, it's a simple built-in function. It returns the index of a substring within a main string. But, I just can't get it to work, it alway

Re: [SQL] use of arrow keys to traverse history

2001-04-25 Thread Dorin Grunberg
You need to install Readline library. I know I used readline 4.1 and it works great. Dorin At 12:42 PM 4/25/2001 -0600, Peter J. Schoenster wrote: >Hi, > >Not sure where this question belongs ... I thought postgresql was >running under the bash shell where I can use up and down arrow >keys to

Re: [SQL] Help Retrieving Latest Record

2001-02-16 Thread Dorin Grunberg
It would be something like: select * from basket where Date=(SELECT max(Date) from basket); At 09:41 AM 2/16/2001 -0500, Steve Meynell wrote: >Hi, I am not sure if this went through the first time so here it is again. > > >Ok what I am trying to do is select out of the database the latest rec

[SQL] Subselects with IN and EXISTS

2000-07-10 Thread Dorin Grunberg
Hello, Here is my query. SELECT id, title, type, sub_type, order_number, version, date, referred_to, referred_in FROM sop WHERE (type||sub_type||order_number, version) IN ^^^ (SELECT type||sub_type||order_number, max(version) FROM sop GROUP BY type||sub_type||order_number) ORDER BY type, sub_t

Re: [SQL] Wildcard in date field???

2000-06-22 Thread Dorin Grunberg
SELECT * FROM my_table WHERE date_part('month', col_name::datetime) = '06' AND date_part('year', col_name::datetime) = '2000'; Looks for more detail in the manual for "date_part" Dorin At 03:52 PM 6/22/2000 -0400, Web Manager wrote: >Hello, > >I need to make a query that will select items t