Selecting rows with specific values in a column

Kuczi

I'm new to SQL. I've got my table with 3 columns. Given a list of values (lets say ints for example 1, 4, 3) I want to select rows in which the second columns value equals something that the given list contains.

Is it possible to pass a list as an argument in SQL?

select * from TABLE1 where ...

How do i finish this statement for it to work as i explained?

I'm using PostgreSQL 9.4

Tim Biegeleisen

Try the following query:

SELECT *
FROM TABLE1
WHERE col2 IN (1, 4, 3);

Most flavors of SQL support the IN clause, which allows comparing a column against a sequence of values. In the query above, we compare col2 against a collection of numbers, but we can equally compare against string literals, etc.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Selecting rows with the most repeated values at specific column

From Dev

Selecting specific rows from a large dataset using column values

From Dev

Selecting rows with specific value in column

From Dev

selecting the rows based on the distinct column values

From Dev

selecting specific lines based on second column values

From Dev

Pandas DataFrame indexing, Selecting rows with specific columns that are NaN values

From Dev

Selecting specific MYSQL rows

From Dev

selecting rows based on multiple column values in pandas dataframe

From Dev

MySQL : Selecting values from a specific column is very slow

From Dev

Selecting the most specific row match based on multiple column values

From Dev

Merging rows if values in a specific column are identical

From Dev

finding rows with specific values for a column (matlab)

From Dev

select rows based on specific column values

From Dev

Selecting specific column in RowDataBound

From Dev

Selecting specific values on a Chart

From Dev

Selecting rows in the table by specific mark

From Dev

selecting rows with specific conditions in R

From Dev

Selecting rows in the table by specific mark

From Dev

Selecting specific rows from table

From Dev

Selecting rows where a column is null

From Dev

Selecting rows where a column is null

From Dev

Selecting specific column value with condition

From Dev

Selecting specific values on script bash

From Dev

Fetch all rows grouped by a specific column using PDO and selecting all columns

From Dev

Selecting varchar values from a column

From Dev

Combining rows on a Dataframe based on a specific column value and add other values

From Dev

Number of specific column values in consecutive rows of dataframe in R

From Dev

How to select specific rows based upon column attribute values in matlab?

From Dev

Total Values of Rows having same value in specific column

Related Related

  1. 1

    Selecting rows with the most repeated values at specific column

  2. 2

    Selecting specific rows from a large dataset using column values

  3. 3

    Selecting rows with specific value in column

  4. 4

    selecting the rows based on the distinct column values

  5. 5

    selecting specific lines based on second column values

  6. 6

    Pandas DataFrame indexing, Selecting rows with specific columns that are NaN values

  7. 7

    Selecting specific MYSQL rows

  8. 8

    selecting rows based on multiple column values in pandas dataframe

  9. 9

    MySQL : Selecting values from a specific column is very slow

  10. 10

    Selecting the most specific row match based on multiple column values

  11. 11

    Merging rows if values in a specific column are identical

  12. 12

    finding rows with specific values for a column (matlab)

  13. 13

    select rows based on specific column values

  14. 14

    Selecting specific column in RowDataBound

  15. 15

    Selecting specific values on a Chart

  16. 16

    Selecting rows in the table by specific mark

  17. 17

    selecting rows with specific conditions in R

  18. 18

    Selecting rows in the table by specific mark

  19. 19

    Selecting specific rows from table

  20. 20

    Selecting rows where a column is null

  21. 21

    Selecting rows where a column is null

  22. 22

    Selecting specific column value with condition

  23. 23

    Selecting specific values on script bash

  24. 24

    Fetch all rows grouped by a specific column using PDO and selecting all columns

  25. 25

    Selecting varchar values from a column

  26. 26

    Combining rows on a Dataframe based on a specific column value and add other values

  27. 27

    Number of specific column values in consecutive rows of dataframe in R

  28. 28

    How to select specific rows based upon column attribute values in matlab?

  29. 29

    Total Values of Rows having same value in specific column

HotTag

Archive