Example

SELECT v.id AS id, v.stock_number AS stock_number, CASE WHEN v.check_in_validated_date IS NOT NULL THEN 'X' ELSE ' ' END AS inspections, CASE WHEN v.detailed = 2 THEN 'X' ELSE ' ' END AS clean_up, DATE_FORMAT(v.ready_date, '%m/%d/%Y') AS ready_date, TIMESTAMPDIFF(WEEK, v.ready_date, NOW()) AS week FROM vehicle v WHERE v.id IN(SELECT v.id FROM vehicle v WHERE v.load_id=6 AND v.ready_date IS NOT NULL)
SQL Snippet

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.