Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select dates
- from table t
- group by dates having count(dates) < k ;
- SELECT * FROM [MyTable] WHERE [Date] IN
- (
- SELECT [Date]
- FROM [MyTable]
- GROUP By [Date]
- HAVING COUNT(*) < @Max
- )
- SELECT Date
- FROM SomeTable
- GROUP BY Date
- HAVING COUNT(*) < @k
- DECLARE @Max int
- SELECT @Max = 5
- SELECT t1.*
- FROM [MyTable] t1
- JOIN(
- SELECT [Date]
- FROM [MyTable]
- GROUP By [Date]
- HAVING COUNT(*) < @Max
- ) t2 on t1.[Date] = t2.[Date]
- SELECT Date FROM table GROUP BY Date HAVING COUNT(*)<k
- SELECT * FROM Table WHERE Date IN (
- SELECT Date FROM table GROUP BY Date HAVING COUNT(*)<k)
- SELECT date, COUNT(date)
- FROM table
- GROUP BY date
- HAVING COUNT(date) < k
- SELECT table.*
- FROM table
- INNER JOIN (
- SELECT date, COUNT(date)
- FROM table
- GROUP BY date
- HAVING COUNT(date) < k) dates ON table.date = dates.date
- select date_col,count(*)
- from your_table
- group by date_col
- having count(*) < 5;
- select trunc(date_col) as date_col,count(*)
- from your_table
- group by trunc(date_col)
- having count(*) < 5;
Add Comment
Please, Sign In to add comment