Jump to content

[SOLVED] Getting the 3rd value in a MySQL table column.


ridiculous

Recommended Posts

Can't find any documentation on this, and the only workarounds I've seen are ridiculous-like me.

 

 

This code doesn't work for MySQL, because MySQL is flitty.

 

 

 

 

 

 

 

 

 


mysql_query ("

				Select MAX(price) as ask2, sum(quantity) as bid_1
					from 85068ramiros13 
						where action ='sell' 
							AND price 
						NOT IN(SELECT MAX(price) FROM 85068ramiros13 ORDER BY PRICE desc limit 2 ) 
					GROUP BY PRICE 

					desc limit 2
				") 

 

 

 

 

Sing with me, from Foreigner: "Urgent, emergency. Urgent, urgent, urgent...emergency.

"

This will get you the second value in a column, but I can't figure out how to augment it to retrieve the 3rd.

 


mysql_query ("

			Select MAX(price) as ask2, sum(quantity) as bid_1
					from table 
						where action ='sell' 
							AND price 
						NOT IN(SELECT MAX(price) FROM table ORDER BY PRICE) 
					GROUP BY PRICE 

					desc limit 2
				") 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.