0

Hi,

PO-1-09/09 is a data stored in varchar column. When i do select * from table myid='PO-1-09/09' , it doesn't return any value. If i change PO-1-09/09 to 5, and search for it, 5 returned related data.

Why PO-1-09/09 doesn't work?

Thanks

3
Contributors
6
Replies
7
Views
8 Years
Discussion Span
Last Post by urtrivedi
0

Sorry. Yes i have.

Select * from table1 Where myid='PO-1-09/09';

Also, Like and IN don't work as well.

0

Sorry. Yes i have.

Select * from table1 Where myid='PO-1-09/09';

Also, Like and IN don't work as well.

Like I said, what is the data type for that field?

0

Related column is "invoiceid". Also, this is a PostgreSQL database. As i couldn't find place to post it, i have chosen this forum.

CREATE TABLE "public"."orders" (
"id" int4 DEFAULT nextval('orders_seq'::text) NOT NULL,
"total" numeric(11,2) DEFAULT 0.00,
"delivery" numeric(11,2) DEFAULT 0.00,
"invoiceid" varchar(15) DEFAULT NULL,
CONSTRAINT "orders_pkey" PRIMARY KEY ("id")
) 
WITH OIDS ;

ALTER TABLE "public"."orders" OWNER TO "iz";
0

Your query is

Select * from table1 Where myid='PO-1-09/09';

You should post exact query instead of sample or example, to rectify it.

I think query should be

Select * from orders Where trim(invoiceid)='PO-1-09/09';
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.