Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / July 2006

Tip: Looking for answers? Try searching our database.

Select First Record

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rookie - 27 Jul 2006 13:24 GMT
I have a table with all the support tickets of my clients, I need to know,
whene was the first ticket of each user, I know distinct can do that, but I
need the full row.

I tried this:
SELECT * FROM `MyCRM`.`ticket_history` a where  Fecha = (SELECT MIN(b.Fecha)
FROM `MyCRM`.`ticket_history` b WHERE b.Fecha = a.Fecha)

but it didnt worked...
Simon Sabin - 28 Jul 2006 00:13 GMT
Hello rookie,
SELECT TOP 1 columns1, column2 etc...
FROM MyCRM.ticket_history
ORDER BY Fecha ASC

If Fecha is the column holding the date the ticket was posted.

ps you shouldn't really use select *

Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons

> I have a table with all the support tickets of my clients, I need to
> know, whene was the first ticket of each user, I know distinct can do
[quoted text clipped - 5 lines]
> FROM `MyCRM`.`ticket_history` b WHERE b.Fecha = a.Fecha)
> but it didnt worked...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.