Select multiple rows from table based on ID

Joanny

I have a table like this:

ID  KEY
15  hello
16  world
17  done

I want to select rows 15 and 17. I tried this:

SELECT * FROM USERSMETA where ID=15,17

But it’s not working. What can I do instead?

Sadikhasan

Try this

SELECT * FROM USERSMETA where ID in(15,17);

OR

SELECT * FROM USERSMETA where ID=15 OR ID=17;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

php select entire table and set variables from multiple rows by id

From Dev

SQL SELECT from TABLE B based on column but grab all rows based on TABLE A ID

From Dev

MYSQL Select from tables based on multiple rows

From Dev

select single row from multiple rows by id

From Dev

Insert multiple rows from select into another table

From Dev

select rows from table based on data from another table

From Dev

select rows from table based on data from another table

From Dev

Select rows from a table based on max value in different table

From Dev

Select rows from a table based on max value in different table

From Dev

SQL: Linking Multiple Rows in Table Based on Data Chain in Select

From Dev

Select rows from table by id of a left join table

From Dev

Select values from multiple rows from 1 table as 1 record

From Dev

Select values from multiple rows from 1 table as 1 record

From Dev

Selecting data from multiple rows from a temporary table create by SELECT

From Dev

Select all rows in table1 and all matched rows in table2 in same row based on ID

From Dev

Laravel select random rows from table based on another field

From Dev

Select rows from a DataFrame based on multiple values in a column in pandas

From Dev

Select one row from multiple rows based on one field

From Dev

Select one row from multiple rows based on availability

From Dev

Removal of Duplicate Rows from Data table Based on Multiple columns

From Dev

INSERT rows multiple times based on a column value from another table

From Dev

How to extract multiple rows from a table based on values from multiple columns from another table and then concatenate in SQL?

From Dev

Select count(*) from table where (multiple id) in (table)

From Dev

How to select a single row where multiple rows exist from a table

From Dev

Select multiple rows from html table and send values to a function in javascript

From Dev

select multiple column from one table and insert into another as rows

From Dev

MySQL select and update multiple rows from same table

From Dev

How to select a single row where multiple rows exist from a table

From Dev

SELECT Columns FROM other Table but Should Return Multiple Rows

Related Related

  1. 1

    php select entire table and set variables from multiple rows by id

  2. 2

    SQL SELECT from TABLE B based on column but grab all rows based on TABLE A ID

  3. 3

    MYSQL Select from tables based on multiple rows

  4. 4

    select single row from multiple rows by id

  5. 5

    Insert multiple rows from select into another table

  6. 6

    select rows from table based on data from another table

  7. 7

    select rows from table based on data from another table

  8. 8

    Select rows from a table based on max value in different table

  9. 9

    Select rows from a table based on max value in different table

  10. 10

    SQL: Linking Multiple Rows in Table Based on Data Chain in Select

  11. 11

    Select rows from table by id of a left join table

  12. 12

    Select values from multiple rows from 1 table as 1 record

  13. 13

    Select values from multiple rows from 1 table as 1 record

  14. 14

    Selecting data from multiple rows from a temporary table create by SELECT

  15. 15

    Select all rows in table1 and all matched rows in table2 in same row based on ID

  16. 16

    Laravel select random rows from table based on another field

  17. 17

    Select rows from a DataFrame based on multiple values in a column in pandas

  18. 18

    Select one row from multiple rows based on one field

  19. 19

    Select one row from multiple rows based on availability

  20. 20

    Removal of Duplicate Rows from Data table Based on Multiple columns

  21. 21

    INSERT rows multiple times based on a column value from another table

  22. 22

    How to extract multiple rows from a table based on values from multiple columns from another table and then concatenate in SQL?

  23. 23

    Select count(*) from table where (multiple id) in (table)

  24. 24

    How to select a single row where multiple rows exist from a table

  25. 25

    Select multiple rows from html table and send values to a function in javascript

  26. 26

    select multiple column from one table and insert into another as rows

  27. 27

    MySQL select and update multiple rows from same table

  28. 28

    How to select a single row where multiple rows exist from a table

  29. 29

    SELECT Columns FROM other Table but Should Return Multiple Rows

HotTag

Archive