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 9249055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:05:50+00:00 2026-06-18T10:05:50+00:00

This had been asked multiple times, but I am not finding a solution that

  • 0

This had been asked multiple times, but I am not finding a solution that works for me. I have a view similar to below. I need to run a query that returns all of the columns, but only once for any unique GLASS_ID. I also need a where clause WHERE GLASS_ID LIKE ‘%’ + @PartialGlassId + ‘%’

VEH_ID   GLASS_ID   OPENING_SEQ  PART_NUM  PREFIX_CD ANT_FLAG  BLK_SIZE1
26975     DB00201        1          201       DB        Y        14.00
26864     DB00375        1          375       DB        N        16.00
26865     DB00375        1          375       DB        N        16.00
26866     DB00375        1          375       DB        N        16.00
38929     DB00408        1          408       DB        N        12.00
38930     DB00408        1          408       DB        N        12.00
38931     DB00408        1          408       DB        N        12.00
38932     DB00408        1          408       DB        N        12.00
38933     DB00408        1          408       DB        N        12.00
38990     DB00408        1          408       DB        N        12.00
38991     DW01015        1         1015       DB        N        12.00

The results should be


VEH_ID NAGS_GLASS_ID OPENING_SEQ PART_NUM PREFIX_CD ANT_FLAG BLK_SIZE1
26975 DB00201 1 201 DB Y 14.00
26864 DB00375 1 375 DB N 16.00
38929 DB00408 1 408 DB N 12.00

for WHERE GLASS_ID LIKE ‘%DB00%’

  • 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-18T10:05:51+00:00Added an answer on June 18, 2026 at 10:05 am
    SELECT b.* 
    FROM yourTable b
    INNER JOIN
      (SELECT MIN(VEH_ID) as minV,  GLASS_ID as g
       FROM yourTable
       GROUP BY GLASS_ID) as d
      ON b.Glass_ID = d.g and b.VEH_ID = d.minV
    WHERE b.GLASS_ID LIKE  '%DB00%'
    

    NOTE : the WHERE clause, in this case, could be in the subquery from the INNER JOIN also.

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

Sidebar

Related Questions

I know this question had been asked a hundred times, but I have difficulties
This question may have been asked before, but I had trouble finding an answer,
I am aware that this had been asked MANY times, but i've spent a
I know that this question had been asked many times, but every answer seems
The question has been asked multiple times, but this is not a repeat. I
I know that this question had already been asked a couple of times before,
This task has already been asked/answered, but I recently had a job interview that
Alright, I know questions like this have probably been asked dozens of times, but
I'm sure this had been asked a lot of times, but I truly can't
This has been asked before but without an answer that works for me (and

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.