I need to select a table, but it's keeping returning error when i tried to using "where" for some column.
here's my code, and i attach an image file for detail.
sirima=# select * from sirima.program_studi;
kode | nama | jenis_kelas | nama_fakultas | jenjang
------+-----------------+---------------+---------------------------------+---------
1 | Kedokteran | Reguler | Kedokteran | S1
2 | Matematika | Reguler | Matematika dan Pengetahuan Alam | S1
3 | Teknik Sipil | Reguler | Teknik | S1
4 | Ilmu Komputer | Reguler | Ilmu Komputer | S1
5 | Kedokteran | Reguler | Kedokteran | S2
6 | Fisika | Reguler | Matematika dan Pengetahuan Alam | S2
7 | Teknik Sipil | Reguler | Teknik | S2
8 | Ilmu Komputer | Reguler | Ilmu Komputer | S2
9 | Kedokteran | Reguler | Kedokteran | S3
10 | Biologi | Reguler | Matematika dan Pengetahuan Alam | S3
11 | Teknik Sipil | Reguler | Teknik | S3
12 | Ilmu Komputer | Reguler | Ilmu Komputer | S3
13 | Kedokteran | Internasional | Kedokteran | S1
14 | Biologi | Internasional | Matematika dan Pengetahuan Alam | S1
15 | Teknik Industri | Internasional | Teknik | S1
16 | Ilmu Komputer | Internasional | Ilmu Komputer | S1
17 | Kedokteran | Paralel | Kedokteran | S1
18 | Biologi | Paralel | Matematika dan Pengetahuan Alam | S1
19 | Teknik Industri | Paralel | Teknik | S1
20 | Ilmu Komputer | Paralel | Ilmu Komputer | S1
(20 rows)
sirima=# select * from sirima.program_studi where jenis_kelas = "Reguler";
ERROR: column "Reguler" does not exist
LINE 1: ...t * from sirima.program_studi where jenis_kelas = "Reguler";
use single quotes:
select * from sirima.program_studi where jenis_kelas = 'Reguler';
https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html:
Double quotes are for identifiers while single quotes are for strings.
where jenis_kelas = 'Reguler'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With