When MySQL has a syntax error, it says something like "syntax error near...". It tends to take me a friggin half an hour to find out I forgot a comma somewhere. is there a better way? 
Tiiba":1d2tk4gy said:When MySQL has a syntax error, it says something like "syntax error near...". It tends to take me a friggin half an hour to find out I forgot a comma somewhere. is there a better way?![]()
^ optimist.topham":i50ikita said:MySQL is brutal in many, many ways. It will bite you in the ass a dozen different ways.
Yeah, but having the INSERT statement be able to use the UPDATE syntax is pretty cool. I'm not a fan of dealing with the column name list and value/parameter list being separate.Blacken00100":2yodfdg1 said:^ optimist.topham":2yodfdg1 said:MySQL is brutal in many, many ways. It will bite you in the ass a dozen different ways.
Blacken00100":3b4t808j said:<insert postgres link here>
Tiiba":2k8isbd9 said:When MySQL has a syntax error, it says something like "syntax error near...". It tends to take me a friggin half an hour to find out I forgot a comma somewhere. is there a better way?![]()
SELECT tb1.column1, tb1.column2,
tb2.column1, tb2.column2, tb2.column3
FROM table1 AS tb1
LEFT JOIN table2 AS tb2
ON tb1.column1 = tb2.column2
WHERE tb1.column1 = "something"
AND tb2.column3 = "somethingelse"
Syntax error on line one near "SELECT tb1.column1, tb1.column2, tb2.column1, tb2.column2, tb2.column3 FROM table1 AS tb1 LEFT JOIN table2 AS tb2 ON tb1.column1 = tb2.column2 WHERE tb1.column1 = "something" AND tb2.column3 = "somethingelse"" Good luck, dipshit!
Blacken00100":143iqz7r said:^ optimist.topham":143iqz7r said:MySQL is brutal in many, many ways. It will bite you in the ass a dozen different ways.
wallinbl":3ghhpg5a said:Yeah, but having the INSERT statement be able to use the UPDATE syntax is pretty cool. I'm not a fan of dealing with the column name list and value/parameter list being separate.Blacken00100":3ghhpg5a said:^ optimist.topham":3ghhpg5a said:MySQL is brutal in many, many ways. It will bite you in the ass a dozen different ways.
Sure. I haven't used MySQL in years, but it was the one thing about it that I remember thinking should be in other SQL implementations. Probably a simple thing to implement as well.fitten":w39e7761 said:wallinbl":w39e7761 said:Yeah, but having the INSERT statement be able to use the UPDATE syntax is pretty cool. I'm not a fan of dealing with the column name list and value/parameter list being separate.Blacken00100":w39e7761 said:^ optimist.topham":w39e7761 said:MySQL is brutal in many, many ways. It will bite you in the ass a dozen different ways.
Yeah, but it's hardly unworkable.
wallinbl":392bjcum said:Sure. I haven't used MySQL in years, but it was the one thing about it that I remember thinking should be in other SQL implementations. Probably a simple thing to implement as well.
but you get the added bonus of being told what line your error is on