|Mar 26 2013, 6:40pm Anchor|
I'm having a issue exporting a column from a mysql table, i need a specific column as i need to use the field then run a replace query on them, the current export is only doing the whole sheet, with one line per row, with all the column details in the first row of the exel document.
I need the first row and column to just consist of the url column from the table, any ideas?
|Mar 26 2013, 6:52pm Anchor|
|Mar 26 2013, 7:29pm Anchor|
|Mar 26 2013, 9:08pm Anchor|
Well, to get a single colon from an SQL DB table you simply use the SELECT command similar to this:
What you did is most probably selecting all colons which would:
You can also filter while export:
Replace by itself you can do directly in the DB without any export. Would look something like this:
That is if you plan to set the same value to all colons matching your condition.
How the export looks like though depends on your DB client. I hope I understood correctly what you are looking for. Otherwise just ask again.
|Apr 1 2013, 2:21pm Anchor|
ok next issue, got the exports sorted but i need to sort the table data so each line matches with the correct url
|Apr 1 2013, 3:13pm Anchor|
Sorting works from inside Excel as well as from inside the DB. In Excel just select all lines (and all columns containing data) and use the sort feature. The program keeps lines together while sorting. In the DB just use the ORDER BY clause as mentioned above. This keeps also the lines together.
|Apr 1 2013, 4:28pm Anchor|
i have the two table sets but the urls differ so its not sorting it 1-1
|Apr 1 2013, 6:58pm Anchor|
So if I get this right you've got two tables let's say A and B with each having an url somewhere (let's say A.url and B.url). You want to merge-sort them. Assuming there is a property A.link and B.link that match each other you can do this using a JOIN clause. This would look like this:
SELECT * FROM A INNER JOIN B ON ( A.link = B.link ) ORDER BY A.url ;
The INNER JOIN simply creates a new temporary table out of table A and B linking rows where A.link matches B.link . The ORDER BY applies then to the joined table and delivers the result you want.
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.