I have a question, I have.

 
Strathman: I’m trying to do it on a Presto instance. I remember someone mentioning the SQL Server hack answer to me a while ago though

Strathman: Presto is pretty slick

Valiente: Hi guys, im not sure if this is possible but might as well just ask, before outputing the results from a mysql query can i add lets say +3 to a value that will be outputed for the top 3 results?

Langan: I am trying to update a field based on a subselect but run into ERROR 1093 HY000: You can’t specify target table ‘kev_product’ for update in FROM clause

Garst: Http://pastie.org/10411223

Veigel: I understand the error, but not how to get around it

Tulloch: Shai-Tan: update kev_product SET pro_id=LEFT pro_description, LOCATE’ ‘, pro_description – 1;

Deconti: Subqueries return a table, not a row and not a value.

Carswell: I need to change a PK INT field to VARCHAR. Is the correct process to drop the PK, alter table, add new PK?

Rosman: So I’ve never done this before but it should be simple.

Deboe: I have a single table and I want to sum up all the values of column A with one WHERE clause and subtract other values from Column A with a different WHERE clause.

Hernanadez: It’s a ‘character experience’ system and I am hoping to count up TOTAL AVAILABLE EXPERIENCE by subtracting SPENT from GAINED

Sewer: I’m not sure exactly how you do this kind of math. I’ve returned the ‘max’ of a field before and count and stuff like that, but this has me headscratchy

Picart: I can totally do it with two queries but I wonder how you’d do it in one :

Mooradian: Basically I wanna combine these:

Brumitt: SELECT sumxp_amount from table where player_id=1 and xp_type=’GAIN’ – SELECT sumxp_amount from table where player_id=1 and xp_type=’SPEND’

Kubesh: All the do***entation I keep running into is incredibly Niedzwiedzki-dense. :

Riviere: Some one is still alive 😀

Giombetti: Volund: can you be a bit more specific? what’s your schema like?

Randoll: When im running this query:

Schwemmer: UPDATE temp_foo SET points = 98989898

Yuengling: SELECT id FROM temp_foo order by total_time ASC LIMIT 1

Sibgert: I get an error “This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery'”

Teter: Is there any other way? :

Posson: Life_in_4k: haven’t actually completely designed the table yet. but I have ONE table with like 5 columns/fields and just want to subtract query B from query A in one query. all the data comes from the same table.

Perring: But if you gimme a bit I’ll go do that.

Blauch: I know that it’s possible to do some math with the returned values/fields.

Rounsville: Volund: have you tried using a union?

Polansky: Tocka: that subquery seems kinda wasteful. try using MIN instead

Pollot: Life_in_4k: haven’t tried ANYTHING yet. I was simply asking for some input. anyhoo.

Rief: Quick question while I actualyl do design the table:

Lemin: Since I am having a terrible time with the mysql do***ents: FLOATM,D UNSIGNED ZEROFILL — what does M,D refer to here?

Magnall: Tocka: the way your query is set up, you sort the entire table and only use one value. n*logn vs n

Vollmers: Life_in_4k hmmm. im a bit confused where should I use MIN?

Sliney: How can I select all tables that start with wp_ and rename them? So far I have SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = not sure if this is right I feel like I’m getting somewhere

Burchell: Volund: can you tell me more about what this table represents?

Peth: Sliney: you’ll want to look into “LIKE”.

Sliney: Life_in_4k: where would I include like?

Sliney: Could I do something.select like “wp_%” from .?

Hermandez: I have a question, I have an auction website that is maxing out the mysql server when it pulls data from the database about an auction, I have given it 8 cpu’s and 16 gb of ram, and it still maxes out the cpu, will mysql alwqays max the cpu or is this an indication of a problem with the query?