Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    147
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Using a field as reference

    Hi,

    I have a table with 2 columns (in MSAccess). At the present time when I call
    by columnx it shown all records of columnx. How I do to select only that records with same variable in columny?

    For example:

    COLUMNXCOLUMNY

    copper 1
    cultural 1
    safari 1
    welcome 1
    boast 2
    hourney 2
    flat 2
    intention 2
    rummage 3
    door 3
    despite 3


    How I select the elements in columX that have the same columnY?

    Thank you in advance.

    Lebron

  • #2
    Regular Coder
    Join Date
    Jan 2005
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you want records where columnx = columny use that in a where clause
    Code:
    SELECT * FROM tbl_TableName WHERE columnx = columny

  • #3
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Quote Originally Posted by lebronletchev View Post
    How I select the elements in columX that have the same columnY?
    Code:
    SELECT columnx FROM tbl_TableName WHERE columny = 1

  • #4
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    147
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you for both suggestions.

    Lebron


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •