2

I have a table as: T(Id integer,Col1 text) In table T has data:

enter image description here

Row 1:
Id= 1
Col1="abc"

Row 2:
Id=2
Col1="940
920
900
880
860

840
820
800
780
760

740
720
700
690
680

670
660
650
640
630

620
610
600
590
580

570
560
550
540
530

520
510
500
490
480

470
460
450
440
430

420
410
400
390
380

370
360
350
340
330"

I have a query is:

SELECT
  *
FROM
  T
where Col1 = '940
920
900
880
860

840
820
800
780
760

740
720
700
690
680

670
660
650
640
630

620
610
600
590
580

570
560
550
540
530

520
510
500
490
480

470
460
450
440
430

420
410
400
390
380

370
360
350
340
330'

Query doesn't return row 2. Why? can you help me? Thanks all.

11
  • 2
    It looks like you're missing whitespace in the query? Although that might be a formatting problem. Querying for such a string of numbers seems like a wrong solution for the problem though but I cannot say much about that without having more information about what you're trying to do. Commented Sep 5, 2013 at 13:13
  • Value of columns is only Multi line. Commented Sep 5, 2013 at 13:17
  • I had compared value in table and value input is the same. Commented Sep 5, 2013 at 13:18
  • 2
    how do you perform the query? are you sure your whitespace \n \r \t <spaces> stays intact and is not accidentally transformed? Commented Sep 5, 2013 at 13:41
  • 1
    If I should do something like this at my job, I would be very very sad. Do you know who designed this DB? Commented Sep 5, 2013 at 14:09

1 Answer 1

1

I'm posting this as answer only because my comment is too long. The following works in PostgreSQL so I guess it does not work for you because strings are not the same.

create table a (a varchar);

insert into a values('940
920
900
880
860

840
820
800
780
760

740
720
700
690
680

670
660
650
640
630

620
610
600
590
580

570
560
550
540
530

520
510
500
490
480

470
460
450
440
430

420
410
400
390
380');

select * from a where a = '940
920
900
880
860

840
820
800
780
760

740
720
700
690
680

670
660
650
640
630

620
610
600
590
580

570
560
550
540
530

520
510
500
490
480

470
460
450
440
430

420
410
400
390
380';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.