Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8148685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:41:41+00:00 2026-06-06T14:41:41+00:00

INSERT INTO table_a (col_tinyint, col_varchar) SELECT 0, distinct(col_other_varchar) COLLATE utf8_bin FROM table_b I want

  • 0
INSERT INTO table_a (col_tinyint, col_varchar)
SELECT 0, distinct(col_other_varchar) COLLATE utf8_bin FROM table_b

I want to select distinctively and case sensively from table_b but this query creates errors. How can I solve this?

I get the error:

Error is SQL Syntax #1064

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:41:42+00:00Added an answer on June 6, 2026 at 2:41 pm

    The DISTINCT keyword must come immediately after SELECT.

    You should also be aware that it applies to the entire row and not to a single column, regardless of any parentheses you might choose to add.

    INSERT INTO table_a (col_tinyint, col_varchar)
    SELECT DISTINCT 0, col_other_varchar COLLATE utf8_bin
    FROM table_b
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I type: INSERT INTO table_b SELECT rowid, somecolumn FROM table_a ...the rowid column
I'm running a pretty standard INSERT INTO [table] (col1, col2, ...coln) select * from
insert into table b select * from table a (nolock) Where do I put
I want to insert into my table a column named 'S' that will get
I have the following query to insert into a table BULK INSERT tblMain FROM
I want to insert data into a table where I don't know the next
I am trying to insert into Table A, unique data from Table B that
I have an insert sql statement, e.g. INSERT INTO `table_a` (`col_a`, `col_b`, `col_c`, `col_d`)
I have the following query: INSERT INTO table (a, b, c) VALUES (NOW(), NOW()
Is it possible to insert into a table variable without defining the schema? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.