Jump to content

search for equal values in one column


asmith

Recommended Posts

can i search a column to see if at least 2 values are the same in 2 different rows ?

i need to choose one value from a  table  IF  no other row has the same values .

 

example :

 

table :

 

id  int1  int2    int3    int4

1    56    24      36      48

2    14    34      23      29

3    56    24      34      44

4    34    26      76      23

 

 

i want to select id ,  where int1 is the max . if it found 2 or more rows with the same max number, then select id from this 2 or more where int2 is the max , if int2 were the same .... goto int3  ..... int 4 .      if the last int were the same too , select nothing .

 

can i do that ?

 

Link to comment
Share on other sites

ok , if that is not possible , how can i search it a row where a column is max in it ? i searched for an hour but didn't find what i want .

 

something like :

 

select id from table where int1 is maximum

 

it seems i can't get a right syntax for it ,

how can i achieve this ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.