Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL statment

SQL statment

Scheduled Pinned Locked Moved Database
questiondatabasehelp
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    charbelasmar
    wrote on last edited by
    #1

    hi guys i have question in SQL select * from user where id='aaa' and pass='hello'; the problem is who can i make it case sensitive like if in my table AAA exist it's different then aaa how can i select the exacte word Regards, Charbel

    C M S 3 Replies Last reply
    0
    • C charbelasmar

      hi guys i have question in SQL select * from user where id='aaa' and pass='hello'; the problem is who can i make it case sensitive like if in my table AAA exist it's different then aaa how can i select the exacte word Regards, Charbel

      C Offline
      C Offline
      cbhkenshin
      wrote on last edited by
      #2

      hi, First of all if your user table has an identity column PK so you can get the data by The PK. Second here is a function that may come in handy //For small a at the begining Select * from user Where ASCII( id ) = 97 //for Big a at the begining Select * from user Where ASCII (id ) = 65 ASCII Function: Returns the ASCII code value of the leftmost character of a character expression.

      1 Reply Last reply
      0
      • C charbelasmar

        hi guys i have question in SQL select * from user where id='aaa' and pass='hello'; the problem is who can i make it case sensitive like if in my table AAA exist it's different then aaa how can i select the exacte word Regards, Charbel

        M Offline
        M Offline
        Michael Potter
        wrote on last edited by
        #3

        Cast them to varbinary:SELECT * FROM user WHERE CAST(id AS VARBINARY(50)) = CAST('aaa' AS VARBINARY(50)) AND CAST(pass AS VARBINARY(50)) = CAST('hello' AS VARBINARY(50))

        1 Reply Last reply
        0
        • C charbelasmar

          hi guys i have question in SQL select * from user where id='aaa' and pass='hello'; the problem is who can i make it case sensitive like if in my table AAA exist it's different then aaa how can i select the exacte word Regards, Charbel

          S Offline
          S Offline
          shm53
          wrote on last edited by
          #4

          Not an issue unless the database is set to be case sensitive. Other wise you can do this select * from user where UPPER(id) = UPPER('aaa') and UPPER(pass)= UPPER('hello');

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups