SAS: Select rows where the ID is in another table

Galadude

I have two tables, that both have an ID column. I'd like to select the rows in the one table, that have an ID that is in the second table.

I R I would do this be saying tbl1[tbl$ID %in% tbl2$ID,], but I haven't found a way to translate this into SAS.

andrey_sz

Try this:

PROC SQL;
CREATE TABLE result AS
SELECT t2.*
FROM table1 AS t1, table2 AS t2
WHERE t1.id = t2.id
;
QUIT;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Select rows in a table where id is equals to another id in another table

From Dev

Select rows in a table where id is equals to another id in another table

From Dev

MySQL - How to select rows in a table where id value is in a comma delimited field in another table?

From Dev

Select all rows from a table except where row in another table with same id has a particular value in another column

From Dev

Select rows not in another table

From Dev

select fields from table where id not in another table in mysql [not working]

From Dev

Select from one table where id (from another table) exists

From Dev

MySql: insert into table SELECT from another table where first_table ID =another_table.id

From Dev

Most efficient way to SELECT rows WHERE the ID EXISTS IN a second table

From Dev

Select rows with same id but different value in another column in a table

From Dev

Linq select Item where it is equal to ID in another table

From Dev

Select Command Where Users id does not appear in another table

From Dev

select from one table, count from another where id is not linked

From Dev

How to select every Id in a table where Id > 118 and insert it with a constant into another Table?

From Dev

MYSQL - Select all rows in a table where it's ids in another table as string field

From Dev

How do I select rows from a table if I know value in another table but not ID?

From Dev

Select all fields from a table where a field in another table with an ID is equal to a string

From Dev

select distinct records where multiple rows exist for one ID based on values in another column

From Dev

delete multiple rows of a table where this data came from another select in postgres

From Dev

Select a user from table where the user isn't logged in and not a part of another tables rows

From Dev

PostgreSQL Get all rows where its id is not anywhere in another column for a table

From Dev

Insert column data rows (all) in another column table where each row matches the common ID

From Dev

Select all from table where the rows has the highest id of all those with the same foreign keys

From Dev

Select EVERY rows where id is NOT distinct

From Dev

Select rows where id is in multiple ranges

From Dev

Getting rows that contain a value from another table SAS

From Dev

Insert multiple rows from select into another table

From Dev

mysql: select rows from another table as columns

From Dev

Select rows according row type in another table

Related Related

  1. 1

    Select rows in a table where id is equals to another id in another table

  2. 2

    Select rows in a table where id is equals to another id in another table

  3. 3

    MySQL - How to select rows in a table where id value is in a comma delimited field in another table?

  4. 4

    Select all rows from a table except where row in another table with same id has a particular value in another column

  5. 5

    Select rows not in another table

  6. 6

    select fields from table where id not in another table in mysql [not working]

  7. 7

    Select from one table where id (from another table) exists

  8. 8

    MySql: insert into table SELECT from another table where first_table ID =another_table.id

  9. 9

    Most efficient way to SELECT rows WHERE the ID EXISTS IN a second table

  10. 10

    Select rows with same id but different value in another column in a table

  11. 11

    Linq select Item where it is equal to ID in another table

  12. 12

    Select Command Where Users id does not appear in another table

  13. 13

    select from one table, count from another where id is not linked

  14. 14

    How to select every Id in a table where Id > 118 and insert it with a constant into another Table?

  15. 15

    MYSQL - Select all rows in a table where it's ids in another table as string field

  16. 16

    How do I select rows from a table if I know value in another table but not ID?

  17. 17

    Select all fields from a table where a field in another table with an ID is equal to a string

  18. 18

    select distinct records where multiple rows exist for one ID based on values in another column

  19. 19

    delete multiple rows of a table where this data came from another select in postgres

  20. 20

    Select a user from table where the user isn't logged in and not a part of another tables rows

  21. 21

    PostgreSQL Get all rows where its id is not anywhere in another column for a table

  22. 22

    Insert column data rows (all) in another column table where each row matches the common ID

  23. 23

    Select all from table where the rows has the highest id of all those with the same foreign keys

  24. 24

    Select EVERY rows where id is NOT distinct

  25. 25

    Select rows where id is in multiple ranges

  26. 26

    Getting rows that contain a value from another table SAS

  27. 27

    Insert multiple rows from select into another table

  28. 28

    mysql: select rows from another table as columns

  29. 29

    Select rows according row type in another table

HotTag

Archive