select name from productimages where productimagesid is min

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[productimages](
      [productimagesid] [int] IDENTITY(1,1) NOT NULL,
      [productid] [int] NOT NULL,
      [name] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF



select name from productimages where productimagesid is min
LVL 1
rgb192Asked:
Who is Participating?
 
Rajkumar GsConnect With a Mentor Software EngineerCommented:
select * from productimages where
productimagesid = (select min(productimagesid) from productimages)
0
 
SharathConnect With a Mentor Data EngineerCommented:
SELECT TOP 1 * 
    FROM productimages 
ORDER BY productimagesid

Open in new window

0
 
rgb192Author Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.