Quick SQL query

진행중 등록 시간: Aug 23, 2015 착불
진행중 착불

Hi, I need some help to build a quick SQL query:

Given table A (

categ int,

prod varchar,

stock int )

I need to get for every categ the 3 pairs (prod, stock) with higher stock.

Example:

Given this table A contents:

categ prod stock

1 st1 65

2 st2 34

3 st3 21

1 st4 11

2 st5 99

3 st6 31

3 st7 12

2 st8 10

1 st9 9

2 st10 17

3 st11 23

1 st12 67

3 st13 87

2 st14 92

1 st15 3

The query should return:

categ prod stock

1 st12 67

1 st1 65

1 st4 11

2 st5 99

2 st14 92

2 st2 34

3 st13 87

3 st6 31

3 st11 23

Pure SQL to be used (DB: MySQL)

Thanks!

MySQL SQL

프로젝트 ID: #8322727

프로젝트 소개

32 건(제안서) 재택 근무형 프로젝트 서비스 이용 중: Aug 23, 2015

이 일자리에 대한 프리랜서 32 명의 평균 입찰가: $13

patzzVJSOFT

will help you with this in a hour thank you Patzz . ...........................................................

$14 USD (1일 이내)
(96 리뷰)
7.6
ParisPallas

Hi there - My name is Paris. I've read your brief and can see that you'd like to have some queries. I have 7 years’ experience designing and developing databases and dealing with SQL queries. I would approach your pro 기타

$10 USD (1일 이내)
(224 리뷰)
7.6
palindromeguy

A proposal has not yet been provided

$12 USD (1일 이내)
(18 리뷰)
5.3
vinaysinghh

I am sql expert certified by Oracle corporation and having more then 5 yrs of experience in sql Oracle and mysql. I can give in few second

$15 USD (1일 이내)
(57 리뷰)
5.2
AliSafder

Very easy and straight forward work. Let me get it done quickly for you (within 5 minutes) I am available instantly.

$10 USD (1일 이내)
(36 리뷰)
5.1
point5nyble

Hello, I have been working with a MNC based company since last ~ 5 years, as an IT BI DWH Professional. The project is a BI DWH project which covers 3 layers of BI (ETL, Data warehouse & Reporting) and helped me in 기타

$15 USD (1일 이내)
(29 리뷰)
4.7
emransl

give me more details....................................................................... Waiting for your reply

$10 USD (1일 이내)
(12 리뷰)
3.7
webkraits

select * from A order by cated desc this is the query you require. and please explain a bit if you think you didnt get desired results maybe I have not fully understood your requirement

$15 USD (1일 이내)
(3 리뷰)
3.4
freelancerwrkr

Hello, I have been working on sql since 4yrs. I can write a query for this. Please award me this bid. Thanks

$10 USD (1일 이내)
(6 리뷰)
3.0
hyperexpert07

If this work, then pay me: Select top 3 pro, categ, stock from tableA group by stock order by stock desc Let me know if it works

$10 USD (1일 이내)
(7 리뷰)
3.1
rizwanfpak

More than 6 years of industry experience, understood your requirements and can easily do this query for you.

$10 USD (1일 이내)
(2 리뷰)
3.0
w3esolution

I have designed and developed more than 200 websites as of now. I have great expertise in Core PHP, Wordpress ,Laravel, Cake PHP, Javascript, Jquery,Ajax, Mysql, HTML,CSS, Webservices, Linux, Apache, 3rd party API’s 기타

$10 USD (1일 이내)
(4 리뷰)
2.9
jperusan

Use this query: WITH B AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY categ ORDER BY categ ASC, stock DESC) AS rn FROM A ) SELECT categ, prod, stock FROM B WHERE rn <= 3 Thanks for reading my proposal.

$10 USD (1일 이내)
(4 리뷰)
2.5
habib9861

Having expertise in PHP,Mysql,Html,C#,CSS,Asp.net. Developed mobile applications and web applications. I have been associated to a well known firm. Having great experience of handling big products. Money is not the iss 기타

$10 USD (1일 이내)
(3 리뷰)
2.2
TauseefSatt1

HI. I will do this SQL query . I will do this on mysql database. I will do this now. can you talk to me now thanks

$10 USD (1일 이내)
(6 리뷰)
4.0
allljprojects

A proposal has not yet been provided

$25 USD (1일 이내)
(1 리뷰)
1.0
Onlance

Sun, 23 Aug 2015 14:05:55 +0000 Could not get pure SQL. Care to elaborate? Can be done for MySQL W

$15 USD (1일 이내)
(1 리뷰)
0.4
ks549

Extracting the specific list from the entire list needs some analysis of data. I can finish it by tomorrow morning. Provide me an opportunity to show my best. Actually I get the point what is the query you are looking 기타

$15 USD (1일 이내)
(0 리뷰)
0.0
banusha90

A proposal has not yet been provided

$15 USD (1일 이내)
(0 리뷰)
0.0
mokshkalra

A proposal has not yet been provided

$15 USD (1일 이내)
(0 리뷰)
0.0