Задать вопрос
Ответы пользователя по тегу SQL
  • Выполнение CASE

    @GalinaM
    Вот таблица с тестовыми данными

    CREATE TABLE [dbo].[TableTest](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [stringwithnumeric] [varchar](50) NULL,
    CONSTRAINT [PK_TableTest] PRIMARY KEY CLUSTERED
    (
    [Id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    SET IDENTITY_INSERT [dbo].[TableTest] ON
    INSERT [dbo].[TableTest] ([Id], [stringwithnumeric]) VALUES (1, N'1')
    INSERT [dbo].[TableTest] ([Id], [stringwithnumeric]) VALUES (2, N'dsa')
    INSERT [dbo].[TableTest] ([Id], [stringwithnumeric]) VALUES (3, N'3')
    INSERT [dbo].[TableTest] ([Id], [stringwithnumeric]) VALUES (4, N'3')
    INSERT [dbo].[TableTest] ([Id], [stringwithnumeric]) VALUES (5, N'gg')
    INSERT [dbo].[TableTest] ([Id], [stringwithnumeric]) VALUES (6, N'del')
    INSERT [dbo].[TableTest] ([Id], [stringwithnumeric]) VALUES (7, N'33')
    INSERT [dbo].[TableTest] ([Id], [stringwithnumeric]) VALUES (8, N'67')
    INSERT [dbo].[TableTest] ([Id], [stringwithnumeric]) VALUES (9, N'97')
    SET IDENTITY_INSERT [dbo].[TableTest] OFF

    Вот запрос

    SELECT
    Id
    ,stringwithnumeric
    FROM dbo.TableTest
    WHERE ISNUMERIC (stringwithnumeric)=1

    Или что-то другое хотелось?
    Ответ написан