Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Get a distinct value from table

Author  Topic 

mary_itohan
Posting Yak Master

191 Posts

Posted - 2014-03-29 : 07:37:59
Hello guys,
how do I get a distinct value of menu from tables

here is my script


thanks

M

select distinct menu, others, clientele,menuID from myrestaurant where username = 'mary' and batch = 238335


_____________________


Yes O !

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-03-29 : 08:21:21
[code]select distinct menu, others, clientele,menuID from myrestaurant where username = 'mary' and batch = 238335[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2014-03-29 : 08:32:15
thanks, but I want those other values in my query

_____________________


Yes O !
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-03-29 : 09:22:51
there are many values for others, clientele etc, which one do you want ?
or maybe perhaps like this ?

select menu, max(others), max(clientele), max(menuID)
from myrestaurant where username = 'mary' and batch = 238335
group by menu



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2014-03-29 : 09:33:08
thanks, it worked.

_____________________


Yes O !
Go to Top of Page
   

- Advertisement -