sql - Table return the result of two rows in one -


this question has answer here:

if have table this:

matchcode  transferid ---------- ----------- 17edce4d   7 17edce4d   17 20332cf0   22 20332cf0   30 

is possible make result return this?

matchcode  transferid1 transferid2 ---------- ----------- ----------- 17edce4d   7           17     20332cf0   22          30  

if each matchcode group have 2 records, can use min , max along group by:

select matchcode, min(transferid) transferid1, max(transferid) transferid2 yourtable group matchcode 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -