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 command error [modified]

sql command error [modified]

Scheduled Pinned Locked Moved Database
databasehelptutorial
11 Posts 7 Posters 11 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.
  • K Offline
    K Offline
    khosnur
    wrote on last edited by
    #1

    Dear Get the list of Customers where Company Name's 2nd letter is Consonant. (Table: Customers) i am using northwind database.plz tell me how to solve that problem. any comments are highly appreciated. Shafik

    modified on Thursday, August 4, 2011 3:45 AM

    S L 2 Replies Last reply
    0
    • K khosnur

      Dear Get the list of Customers where Company Name's 2nd letter is Consonant. (Table: Customers) i am using northwind database.plz tell me how to solve that problem. any comments are highly appreciated. Shafik

      modified on Thursday, August 4, 2011 3:45 AM

      S Offline
      S Offline
      Simon_Whale
      wrote on last edited by
      #2

      What have you tried? Are you using SQL? ADO.NET? LinQ?

      Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

      1 Reply Last reply
      0
      • K khosnur

        Dear Get the list of Customers where Company Name's 2nd letter is Consonant. (Table: Customers) i am using northwind database.plz tell me how to solve that problem. any comments are highly appreciated. Shafik

        modified on Thursday, August 4, 2011 3:45 AM

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        You haven't mentioned what database you are using. For MS SQL Server, it would be:

        SELECT * FROM Customers WHERE SUBSTRING(CompanyName,2,1) NOT IN ('a', 'e', 'i', 'o', 'u')

        T 1 Reply Last reply
        0
        • L Lost User

          You haven't mentioned what database you are using. For MS SQL Server, it would be:

          SELECT * FROM Customers WHERE SUBSTRING(CompanyName,2,1) NOT IN ('a', 'e', 'i', 'o', 'u')

          T Offline
          T Offline
          Tim Carmichael
          wrote on last edited by
          #4

          What is the second character in the computer name is not a letter, like O'Darby?

          P L 2 Replies Last reply
          0
          • T Tim Carmichael

            What is the second character in the computer name is not a letter, like O'Darby?

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            Oh, well then... You'll need two more tables:

            CharacterClass
            ID CharacterClass
            1 Vowel
            2 Consonant
            3 Digit
            4 Symbol
            5 Whitespace

            Character
            Character CharacterClass
            A 1
            B 2
            ...

            Then simply JOIN. :jig:

            T 1 Reply Last reply
            0
            • P PIEBALDconsult

              Oh, well then... You'll need two more tables:

              CharacterClass
              ID CharacterClass
              1 Vowel
              2 Consonant
              3 Digit
              4 Symbol
              5 Whitespace

              Character
              Character CharacterClass
              A 1
              B 2
              ...

              Then simply JOIN. :jig:

              T Offline
              T Offline
              Tim Carmichael
              wrote on last edited by
              #6

              PIEBALDconsult wrote:

              Oh, well then...
               
              You'll need two more tables:

              I know that.. I wanted others to think the answer through...

              G P 2 Replies Last reply
              0
              • T Tim Carmichael

                PIEBALDconsult wrote:

                Oh, well then...
                 
                You'll need two more tables:

                I know that.. I wanted others to think the answer through...

                G Offline
                G Offline
                GenJerDan
                wrote on last edited by
                #7

                Chances are the O' folks never made it into the database because parameters were not used for the input, and no one did a .Replace("'","''") on the SQL string, so it's not an issue.

                It always itches for the first week or so. My Mu[sic] My Films My Windows Programs, etc.

                J P 2 Replies Last reply
                0
                • T Tim Carmichael

                  What is the second character in the computer name is not a letter, like O'Darby?

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  The code was just a heads-up to get the OP started with something. I'd have suggested something better if the OP came back with the specifics.

                  1 Reply Last reply
                  0
                  • G GenJerDan

                    Chances are the O' folks never made it into the database because parameters were not used for the input, and no one did a .Replace("'","''") on the SQL string, so it's not an issue.

                    It always itches for the first week or so. My Mu[sic] My Films My Windows Programs, etc.

                    J Offline
                    J Offline
                    jschell
                    wrote on last edited by
                    #9

                    :) Or because the GUI specifically excludes those because the developer doesn't know anyone with a name like that.

                    1 Reply Last reply
                    0
                    • G GenJerDan

                      Chances are the O' folks never made it into the database because parameters were not used for the input, and no one did a .Replace("'","''") on the SQL string, so it's not an issue.

                      It always itches for the first week or so. My Mu[sic] My Films My Windows Programs, etc.

                      P Offline
                      P Offline
                      PIEBALDconsult
                      wrote on last edited by
                      #10

                      Isn't that just the luck of the Irish. :~

                      1 Reply Last reply
                      0
                      • T Tim Carmichael

                        PIEBALDconsult wrote:

                        Oh, well then...
                         
                        You'll need two more tables:

                        I know that.. I wanted others to think the answer through...

                        P Offline
                        P Offline
                        PIEBALDconsult
                        wrote on last edited by
                        #11

                        I thought I was being facetious in my over-engineering way. :-D

                        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