Search Postgresql Archives

How is the right query for this condition ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear All

Suppose I created a database with single table like this :
------start----------
CREATE DATABASE bino;
CREATE TABLE myrecords(record text);
------end------------

and I fill myrecords with this :
------start----------
COPY myrecords (record) FROM stdin;
1
12
123
1234
\.
------end------------

In my bash script, I have variable called 'vseek', that will be use for query parameter.
How to query the table , for (i.e):

a. If vseek = '127' , I want the result is ==> '12'
b. if vseek = '123987' , I want the result is ==> '123'
c. if vseek = '14789' , I want the result is ==> '1'

Kindly please give me any enlightment

Sincerely
-bino-


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux