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

  • SEARCH
  • Home
  • 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 7559901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:45:26+00:00 2026-05-30T12:45:26+00:00

First query: SELECT `id` FROM (`videos`) WHERE `name` LIKE ‘%Dragon Ball Z (U.S.)%’ and

  • 0

First query:

SELECT `id`
FROM (`videos`)
WHERE  `name`  LIKE '%Dragon Ball Z (U.S.)%' 

and second

SELECT `vid_id` as id
FROM (`other_names`)
WHERE  `name`  LIKE '%Dragon Ball Z (U.S.)%'
GROUP BY `vid_id`

All i want get is list of unique ids by LIKE.

  • 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-05-30T12:45:28+00:00Added an answer on May 30, 2026 at 12:45 pm

    Replace ‘and second’ with ‘UNION’. 🙂

    SELECT `id`
    FROM (`videos`)
    WHERE  `name`  LIKE '%Dragon Ball Z (U.S.)%' 
    UNION
    SELECT `vid_id` as id
    FROM (`other_names`)
    WHERE  `name`  LIKE '%Dragon Ball Z (U.S.)%'
    

    UNION (as opposed to UNION ALL) already returns unique items only, so you won’t need GROUP BY or SELECT DISTINCT. You could write UNION DISTINCT if you think it’s more clear, but you can omit it, since it is the default behaviour of UNION.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First Query: Select * from table1 inner join table2 on table1.Id = table2.Id Second
well this is my problem i use 2 source first query (select * from
The first query is: declare @myDate datetime = DATEADD(D,-2000,getdate()) SELECT * FROM [myTable] where
Let say I retrieve my list of data... First $Query = mysql_query(SELECT * FROM
The title speaks for itself. The first query - SELECT * FROM table _t
First a query SELECT * FROM mytable WHERE id='1' Gives me a certain number
Ok, this is my query: SELECT video_category, video_url, video_date, video_title, short_description, MAX(video_id) FROM videos
We'd like to write this query: select * from table where col1 != 'blah'
This query: select * from table_a , table_b where table_a.id = table_b.id(+) and table_b.name
$STH_1 = $DBH_R->query(SELECT table_name FROM information_schema.tables WHERE table_name LIKE 'v_c_ei\_9%' ); $stmts_1 = array();

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.