WHERE Clause
Is it possible to have a 'worked out value' in the WHERE clause. The problem I have is what I need to check for in the WHERE Clause is not a column: SELECT CONCAT_WS(-,DATE_FORMAT(EntryDate,'%c'),DATE_FORMAT(EntryDate,'%Y')) As mthyr From Blogs WHERE mthyr=1-2003 This does not work as it seems to want a valid column in the WHERE clause. Anyway around it? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
MySQL and Coldfusion
Is anyone on the list using Coldfusion MX with MySql? It's just I've hit a problem I've been hitting my head against for a week or so. The coldfusion people I know have hit a blank (but they are using SQL Server). I'm stretching now in an attempt to find someone with experience of both sides? Thanks in advance. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Multiple Order By
I want to order my articles in descending order on date, and for articles on the same date I want to order by ID in ASC. I've tried the following: ORDER BY EntryDate DESC, ID ASC But it does the EntryDate Order but nothing else. The problem I have is I don't want to record the time (the user enters the date) but I want articles in order of entry - at the moment the oldest article on any particular day is listed first. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Expressions
Regarding the following query: SELECT ID,Author,DATE_FORMAT(EntryDate,'%d %m %y'),SectionID,Title,Summary,Content FROM articles ORDER BY EntryDate DESC LIMIT 10 Okay, I've looked in the manually up and down, as I know how to do it in Access, but I can't find it. I want to set an expression so I can give the Date_Format function a handy name - so it returns the name of the column as ArticleDate, for instance. I'm missing something simple :) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Expressions
rom: sulewski [EMAIL PROTECTED] I think you can just put the alias after the field like so, select id,author,date_format(entrydate,'%d %m %y') ArticleDate, SectionId,Title,Summary... You were correct - the version using AS does not work (I'd tried that before mailing). -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
SQL Query
Any idea what is wrong with the following: SELECT * From articles ORDER BY EntryDate DESC LIMIT 1,10 WHERE SectionID=1 I want to return all articles with a particular SectionID, ordered by EntryDate and then I want to pick the start point and list the next 10 from that. Obviously in the final version the start point and the SectionID will be dynamic. I have tried removing the LIMIT part. I've tried changing the SectionID to a different field it always gives me an uninformative error? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: SQL Query
From: Terry Riley [EMAIL PROTECTED] I think it should be: SELECT * FROM articles WHERE sectionID=1 ORDER BY Entrydate Desc LIMIT 1,10 Terry That would be correct. I'll have to watch out for that ordering in the future. What confused me is if you just have the Select, Order By and Where the Order By can go on the first line. As I say, have to watch that. Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Selecting Articles by Month and Year
I have a series of article in my database and I want to select them by month and year. So I want a Selection List to hold values like January, 2004, etc - put it should really select some sort of key like 01-2004. I should then be able to use that key to filter articles by 01-2004. I'm just a bit unsure about the queries, and how to format queries to: Return the January, 2004 for what the list shows... Return the 01-2004 for the Lists actual section Do a Select using the 01-2004 Currently looking at the DATE FORMAT functions, etc, but any help would be appreciated? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
HTML in Longtext
I seem to be having some problems regarding HTML in Longtext fields - I think it is something to do with the fact that I have items in double quotes in the field. As an example, the html will have double quates along the lines of: p class=articletxt When I pull the field out of the database via the Application Server (Coldfusion in this case) it displays all correctly and when I look at the source all is well. When I put the HTML in a Textarea for editing it cuts out text. But if I look in the souce all the text is there, though I have double quoted items, as above, inside my quotes for the value item of the text area? Am I supposed to be doing something with the content of the textfield to avoid the issue with the quotes? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Longtext Fields
Is there something about longtext fields I'm missing? When I return my longtext field (the Content column of a table containing articles - it contains HTML) and place it in a TextArea on the HTML form it always has the first so many characters missing. If I continually edit the article repeatedly it cuts off so much text each time. Do I have to do something special to retrieve longtext items from the database correctly? Or is it something to do with my HTML form (I can't imagine so, but you never know). -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL as document storage?
Original Message - From: Steve Folly [EMAIL PROTECTED] At work we are currently investigating ways of filing all our electronic documents. I don't know the answer, but it's an interesting question. We are currently looking at using more and more SQL (we use MySQL now in places), and we face looking the issue of storing PDF files and such in a back-end. We also have Lotus Domino - which is very good at this sort of thing - but I'd still be interested in the discussion. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Bet the Business
I've been playing with MySQL for a bit now (and it is playing) and I'm using it for a number of personal sites (ie not many users, and only I really post stuff). I've also adopted it at work, and we use it to dump Lotus Domino information into for more structured reporting. All is good. In the near future we face making a decision for a database backend, and the logical choice for us is MSSQL as we have one server already for Great Plains - but it would seem MySQL is much cheaper. This would be a line of business we application for around 200 people. Obviously, the details are vague here, I was just wondering if anyone had any stories, personal ones, rather than the press announcements, of adopting MySQL for line of business, critical stuff - what it involved, how it went, what issues they faced in getting it accepted and so on. I'm genuinly interested. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Bet the Business
Original Message - From: robert_rowe [EMAIL PROTECTED] Will I use them in MySQL 5.0? Probably, but only when justified. /soapbox So what are the justifications? What makes a wise stored procedure and an unwise stored procedure? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Inserting Dates
I'm very new to MySql and I'm having problems inserting dates into my tables (via the Web using Coldfusion). The user can put the following in the field: 12/09/2003 But the data returned from the database is: 2012-09-20 03:00:00.0 So I'm a bit confused about what I need to do in the insert statement so the user can just add the date (without a time). It's probably something really easy, but it;'s driving me nuts. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Inserting Dates
Thanks a lot, time to look into my Coldfusion sting functions or Date_Format in MySQL. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]