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.
| Author |
Topic |
|
gongxia649
So Suave
344 Posts |
Posted - 2006-05-04 : 21:18:30
|
| t1order itemhow can i get the order that has less than 2 items? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-05-04 : 21:22:09
|
select order, count(*)from t1group by orderhaving count(*) < 2 KH |
 |
|
|
gongxia649
So Suave
344 Posts |
Posted - 2006-05-04 : 21:53:39
|
| if i want to delete how will i do it? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-05-04 : 22:08:51
|
Just inner join it with the table t1.delete dfrom t1 d inner join( select order, count(*) as cnt from t1 group by order having count(*) < 2 ) ton d.order = t.order KH |
 |
|
|
gongxia649
So Suave
344 Posts |
Posted - 2006-05-05 : 08:36:51
|
| what is d? |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-05-05 : 08:37:38
|
d is an alias for a table.maybe you really need to learn about sql?Go with the flow & have fun! Else fight the flow Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"] |
 |
|
|
gongxia649
So Suave
344 Posts |
Posted - 2006-05-05 : 08:48:54
|
| maybe yes hahahahahh |
 |
|
|
|
|
|