select field from table in another field from another table

Rustam

I want this in mysql:

SELECT * FROM Table1 Where Field1=searchword 
OR Field2=searchword 
OR Field3=searchword 
OR ((SELECT filedx FROM Table2 WHERE fieldxx = Field1) = searchword) 

Where The Field1 in 2nd select is from 1st select statment.

vhu

I'm not quite sure what you want, but it looks like you want to match your searchword against Table1.Field2, Table1.Field3 and Table2.filedx. Tables are linked by fieldxx=Field1. In that case you can do simple outer join:

SELECT * FROM Table1
  LEFT OUTER JOIN Table2 ON (fieldxx=Field1)
 WHERE
  Field1=searchword
  OR Field2=searchword
  OR Field3=searchword
  OR filedx=searchword;

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 Additional Field from another Table

From Dev

Call field from another table in select firebase

From Dev

SQLite, select where field 'like' field from another table

From Dev

select multiple columns from another table where field contains array

From Dev

Laravel select random rows from table based on another field

From Dev

Field involving multiple rows from another table

From Dev

Adding a field from another table to results

From Dev

Pull field from another table in MVC

From Dev

Pulling a field from another table in Hibernate

From Dev

Refresh a field from another table [Django]

From Dev

Set field to random value from another table

From Dev

Adding a field from another table to results

From Dev

Pull field from another table in MVC

From Dev

sql - show count of field from another table

From Dev

Add field in a Gii form from another table

From Dev

Delete trigger and getting field from another table

From Dev

DRF: validate a field from another table

From Dev

SQLite select average from one table and update average field from another table using trigger

From Dev

How to create new field in view with some offset (field of table) from existing field (another field of table)?

From Dev

Using values from a field in one table as column name for field in another

From Dev

SELECT field records from a table if it doesn't match a record in another two columns table

From Dev

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

From Dev

Copy Field contents from one Table to another table - FileMaker

From Dev

MYSQL Copy field from one table to another table

From Dev

Using a composite key from one table in a field in another table

From Dev

update table with field boolean requirement from another table

From Dev

MySQL List some field from a single table and COUNT all particular field reference from another table

From Dev

select a field values that are not found in another table

From Dev

select a field values that are not found in another table

Related Related

  1. 1

    Select Additional Field from another Table

  2. 2

    Call field from another table in select firebase

  3. 3

    SQLite, select where field 'like' field from another table

  4. 4

    select multiple columns from another table where field contains array

  5. 5

    Laravel select random rows from table based on another field

  6. 6

    Field involving multiple rows from another table

  7. 7

    Adding a field from another table to results

  8. 8

    Pull field from another table in MVC

  9. 9

    Pulling a field from another table in Hibernate

  10. 10

    Refresh a field from another table [Django]

  11. 11

    Set field to random value from another table

  12. 12

    Adding a field from another table to results

  13. 13

    Pull field from another table in MVC

  14. 14

    sql - show count of field from another table

  15. 15

    Add field in a Gii form from another table

  16. 16

    Delete trigger and getting field from another table

  17. 17

    DRF: validate a field from another table

  18. 18

    SQLite select average from one table and update average field from another table using trigger

  19. 19

    How to create new field in view with some offset (field of table) from existing field (another field of table)?

  20. 20

    Using values from a field in one table as column name for field in another

  21. 21

    SELECT field records from a table if it doesn't match a record in another two columns table

  22. 22

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

  23. 23

    Copy Field contents from one Table to another table - FileMaker

  24. 24

    MYSQL Copy field from one table to another table

  25. 25

    Using a composite key from one table in a field in another table

  26. 26

    update table with field boolean requirement from another table

  27. 27

    MySQL List some field from a single table and COUNT all particular field reference from another table

  28. 28

    select a field values that are not found in another table

  29. 29

    select a field values that are not found in another table

HotTag

Archive