![]() |
| ||
| Max date to max date Hi all, I wonder if it is possible that someone can drop me a code or something on this particular problem which I am currently dealing with. in_date out_date 18/03 30/04 20/04 So how am i supposed to pair up 30/04 and 20/04 as 1 pair and show it up in the table? Many thanx in advance |
| ||
| Re: Max date to max date Here is an example... could you try to be more specific? This will select records with an in_date of '%-03-18' or out_date of '%-04-20': SELECT * |
| ||
| Re: Max date to max date If by 'pair up' you mean that you want them to appear in the same row, I think the approach would be to join the table to itself. So if you had a table like: id description linkid And you want a result like: leftdescription rightdescription A query like this should do it: create table if not exists link2myself(id int, description varchar(6), linkid int); |
| ||
| Re: Max date to max date Lets say you really dont want to create a table and you dont want to join tables but concatenating two records from one table instead........... I think you need to be more specific coz what u said above is completely unclear |
| ||
| Re: Max date to max date Just as a note, the 'CREATE TABLE' is used to create a sample table with some sample data. It has no relation to the solution. In practical usage, you would use the table you already have. Also, if you want to string concatenate some rows you can use the aggregate function group_concat(). But if you want them to appear as separate columns, use join. |
| All times are GMT -4. The time now is 11:24 pm. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC