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

hopefully you have a WHERE clause in that query and what is the datatype of that field?

Sorry. Yes i have.

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

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

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?

Post whole structure of your table

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";

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';
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.