SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    Non-Member
    Join Date
    Dec 2004
    Location
    London
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple query question

    Sorry for the n00b question, but I tried a search and came up empty. My question simply is, how do you geta single value?
    Say this is my table:
    col1__col2__col3__
    1 4 7
    2 5 8
    3 6 9

    How would I get the value in col2 where the value in col1 is 2 (it would be 5)
    Thanks!

  2. #2

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    SELECT col2 FROM yourtable WHERE col1=2


Bookmarks

Posting Permissions

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