sql server - SQL Index selection not Returning multiple Results -


i want know how obtain lowest index number / indno if record contains multiple references (lets got contract containing same metadata, difference index number), several records in same table.

i used distinct / min selections or combination of 2 on indno selection unsuccessful.

this gets lowest indno record, 1 record, instead of them :

select min(indno) lowestindexes  tablename  indno matches criteria in other columns 

example :

indno   col 1     col 2     col 3  1       peanut    butter    jelly 2       peanut    butter    jelly 3       peanut    butter    jelly 4       milk      oreo      infinitejoy 5       milk      oreo      infinitejoy 6               love      sql 7               love      sql 8               love      sql 9               love      sql 10              love      sql 

for set of results must able return smallest index number / indno of each of records :

1   4  6 

try using group this

select      indno     `test`       col1 "your criteria"       or col2 "your criteria"       or col3 "your criteria" group col1 , col2 , col3 order indno asc 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -